]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Move bsd_getopt() from <bsd/getopt.h> to <bsd/unistd.h>
authorGuillem Jover <guillem@hadrons.org>
Sat, 28 May 2011 09:40:36 +0000 (11:40 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sun, 29 May 2011 00:41:16 +0000 (02:41 +0200)
Deprecate <bsd/getopt.h>.

include/bsd/getopt.h
include/bsd/unistd.h

index ba2c4ebce6f3f4b4f5b4d48c1348e6aeb341249d..697f9407ae56b7bcc4f1716f5a740b9c3218c2f8 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright © 2006 Robert Millan
- * Copyright © 2009, 2011 Guillem Jover
+ * Copyright © 2011 Guillem Jover
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef LIBBSD_GETOPT_H
 #define LIBBSD_GETOPT_H
 
-#include <sys/cdefs.h>
-
 #ifdef LIBBSD_OVERLAY
 #include_next <getopt.h>
+#include <unistd.h>
 #else
+#warning "Deprecated header, use <bsd/unistd.h> or <unistd.h> with libbsd-overlay.pc instead."
 #include <getopt.h>
+#include <bsd/unistd.h>
 #endif
 
-__BEGIN_DECLS
-extern int optreset;
-
-#ifdef LIBBSD_OVERLAY
-#undef getopt
-#define getopt(argc, argv, optstr) bsd_getopt(argc, argv, optstr)
-#endif
-
-int bsd_getopt (int, char **, char *);
-__END_DECLS
-
 #endif
index 61aaff47d82038fe506cc9221921ec8cbe7dfece..1c4e579a1f5bafac376c5890c11e60c18f3415a1 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright © 2006 Robert Millan
  * Copyright © 2008-2011 Guillem Jover
  *
  * Redistribution and use in source and binary forms, with or without
 #endif
 
 __BEGIN_DECLS
+extern int optreset;
+
+#ifdef LIBBSD_OVERLAY
+#undef getopt
+#define getopt(argc, argv, optstr) bsd_getopt(argc, argv, optstr)
+#endif
+
+int bsd_getopt(int, char **, char *);
+
 mode_t getmode(const void *set, mode_t mode);
 void *setmode(const char *mode_str);