summaryrefslogtreecommitdiff
path: root/system.h
diff options
context:
space:
mode:
authordevzero2000 <devzero2000>2011-09-05 11:26:39 +0000
committerdevzero2000 <devzero2000>2011-09-05 11:26:39 +0000
commit217bada4e58deff154b285569d584241209b613e (patch)
treefead6bb6900189c42c84e2101c298f8341f67f43 /system.h
parentd9e5032cdf8374f78d832c4127f49c2d728afbee (diff)
downloadlibpopt-217bada4e58deff154b285569d584241209b613e.tar.gz
merge commit 8396019 from git pull request
https://github.com/devzero2000/POPT/pull/2 "Work around missing format for long long in windows; fix warnings" by asenm (Matt Arsenault)
Diffstat (limited to 'system.h')
-rw-r--r--system.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/system.h b/system.h
index e44e18f..b072656 100644
--- a/system.h
+++ b/system.h
@@ -7,7 +7,6 @@
#endif
-
#if defined (__GLIBC__) && defined(__LCLINT__)
/*@-declundef@*/
/*@unchecked@*/
@@ -54,10 +53,18 @@ char *alloca ();
#include <unistd.h>
#endif
+
+#if !defined(__GNUC__) && !defined(__attribute__)
+#define __attribute__(x)
+#endif
+#define UNUSED(x) x __attribute__((__unused__))
+
+
#ifdef _MSC_VER
# define inline __inline
#endif
+
#if defined(_MSC_VER) || defined(__MINGW32__)
#define _CRT_SECURE_NO_WARNINGS 1
#include <io.h>
@@ -73,6 +80,10 @@ char *alloca ();
#define S_ISGID 00020000
#define S_ISVTX 00010000
+/* I haven't discovered a better way to work around these format
+ specifier problems */
+#define LONG_LONG_FORMAT "I64d"
+
/* CHECKME */
#define S_IWGRP 00000020
@@ -112,17 +123,22 @@ typedef int ssize_t;
#define lseek _lseek
/* Pretend to be root to replace these */
-static inline int setuid(int x) { return 1; }
+static inline int setuid(UNUSED(int x)) { return 1; }
static inline int getuid(void) { return 0; }
-static inline int seteuid(int x) { return 1; }
+static inline int seteuid(UNUSED(int x)) { return 1; }
static inline int geteuid(void) { return 0; }
-static inline int setgid(int x) { return 1; }
+static inline int setgid(UNUSED(int x)) { return 1; }
static inline int getgid(void) { return 0; }
-static inline int setegid(int x) { return 1; }
+static inline int setegid(UNUSED(int x)) { return 1; }
+
+
+#else
+
+#define LONG_LONG_FORMAT "lld"
#endif /* defined(_MSC_VER) || defined(__MINGW32__) */
@@ -186,12 +202,7 @@ static inline char * stpcpy (char *dest, const char * src) {
#define getenv(_s) __secure_getenv(_s)
#endif
-#if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(x)
-#endif
-#define UNUSED(x) x __attribute__((__unused__))
-
/* Include configmake.h autogenerated from Makefile.am */
-
#include "configmake.h"
#include "popt.h"
+