summaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:19:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:19:51 +0000
commit19b39815163d510f7ed52bedab507fa72202c15a (patch)
tree30ef0de18a35492922fad0066068ae50ad90a36c /openbsd-compat
parentAdding upstream version 1:9.6p1. (diff)
downloadopenssh-19b39815163d510f7ed52bedab507fa72202c15a.tar.xz
openssh-19b39815163d510f7ed52bedab507fa72202c15a.zip
Adding upstream version 1:9.7p1.upstream/1%9.7p1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/getopt.h12
-rw-r--r--openbsd-compat/openbsd-compat.h10
2 files changed, 19 insertions, 3 deletions
diff --git a/openbsd-compat/getopt.h b/openbsd-compat/getopt.h
index 65c8bc7..b050fa8 100644
--- a/openbsd-compat/getopt.h
+++ b/openbsd-compat/getopt.h
@@ -33,6 +33,14 @@
#ifndef _GETOPT_H_
#define _GETOPT_H_
+#ifndef __THROW
+# if defined __cplusplus
+# define __THROW throw()
+# else
+# define __THROW
+# endif
+#endif
+
/*
* GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
*/
@@ -63,8 +71,8 @@ int getopt_long_only(int, char * const *, const char *,
#ifndef _GETOPT_DEFINED_
#define _GETOPT_DEFINED_
-int getopt(int, char * const *, const char *);
-int getsubopt(char **, char * const *, char **);
+int getopt(int, char * const *, const char *) __THROW;
+int getsubopt(char **, char * const *, char **) __THROW;
extern char *optarg; /* getopt(3) external variables */
extern int opterr;
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 78faea9..0823d6a 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -48,6 +48,14 @@
#include "blf.h"
#include "fnmatch.h"
+#ifndef __THROW
+# if defined __cplusplus
+# define __THROW throw()
+# else
+# define __THROW
+# endif
+#endif
+
#if defined(HAVE_LOGIN_CAP) && !defined(HAVE_LOGIN_GETPWCLASS)
# include <login_cap.h>
# define login_getpwclass(pw) login_getclass(pw->pw_class)
@@ -187,7 +195,7 @@ int getgrouplist(const char *, gid_t, gid_t *, int *);
#endif
#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
-int BSDgetopt(int argc, char * const *argv, const char *opts);
+int BSDgetopt(int argc, char * const *argv, const char *opts) __THROW;
#include "openbsd-compat/getopt.h"
#endif