#ifndef _GETOPT_H_
#define _GETOPT_H_
-#include <sys/cdefs.h>
-
/*
* GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
*/
#define required_argument 1
#define optional_argument 2
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct option {
/* name of long option */
const char *name;
int val;
};
-__BEGIN_DECLS
int getopt_long(int, char * const *, const char *,
const struct option *, int *);
int getopt_long_only(int, char * const *, const char *,
extern int optreset;
extern char *suboptarg; /* getsubopt(3) external variable */
#endif
-__END_DECLS
+
+#ifdef __cplusplus
+}
+#endif
#endif /* !_GETOPT_H_ */