summaryrefslogtreecommitdiffstats
path: root/fastos
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-06-16 10:11:44 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-06-16 10:51:45 +0000
commit4db58e6da803b21f6a66b20c1ba93aba06191a70 (patch)
tree61c9b878e54ca6938b411040801010bf79507cba /fastos
parent9326968eafcaf378de1bc50948bc01163118f432 (diff)
Reorganize defines and use standard format macros.
Diffstat (limited to 'fastos')
-rw-r--r--fastos/src/vespa/fastos/types.h51
1 files changed, 18 insertions, 33 deletions
diff --git a/fastos/src/vespa/fastos/types.h b/fastos/src/vespa/fastos/types.h
index f14119b5a9a..72c7cbd7cf8 100644
--- a/fastos/src/vespa/fastos/types.h
+++ b/fastos/src/vespa/fastos/types.h
@@ -19,10 +19,13 @@
* below, we define the behaviour here.
*/
#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
+ #define __STDC_LIMIT_MACROS 1
#endif
#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS 1
+ #define __STDC_CONSTANT_MACROS 1
+#endif
+#ifndef __STDC_FORMAT_MACROS
+ #define __STDC_FORMAT_MACROS
#endif
#include <assert.h>
@@ -66,18 +69,6 @@
#include <sys/time.h>
#include <time.h>
-#define FASTOS_EMFILE_VERIFIED (-1)
-#ifdef EMFILE
-#undef FASTOS_EMFILE_VERIFIED
-#define FASTOS_EMFILE_VERIFIED EMFILE
-#endif
-
-#define FASTOS_ENFILE_VERIFIED (-1)
-#ifdef ENFILE
-#undef FASTOS_ENFILE_VERIFIED
-#define FASTOS_ENFILE_VERIFIED ENFILE
-#endif
-
#ifndef __USE_GNU
#define __USE_GNU /* for O_DIRECT define */
#define __TYPES_H_DIRECTIO_GNU
@@ -97,32 +88,26 @@
#include <sys/stat.h>
#include <limits.h>
#include <float.h>
-
#include <netinet/tcp.h>
-
-#define FASTOS_PREFIX(a) FastOS_##a
-
#include <inttypes.h>
-
#include <getopt.h>
-/* 64bit printf specifiers */
#if (__WORDSIZE == 64)
- #ifndef PRIu64
- #define PRIu64 "lu"
- #endif
- #ifndef PRId64
- #define PRId64 "ld"
- #endif
- #ifndef PRIx64
- #define PRIx64 "lx"
- #endif
-
#else
- #error "Only 64 environments are supported."
+ #error "Only LP 64 environments are supported."
#endif
-#ifndef PRIu32
- #define PRIu32 "u"
+#define FASTOS_PREFIX(a) FastOS_##a
+
+#define FASTOS_EMFILE_VERIFIED (-1)
+#ifdef EMFILE
+#undef FASTOS_EMFILE_VERIFIED
+#define FASTOS_EMFILE_VERIFIED EMFILE
+#endif
+
+#define FASTOS_ENFILE_VERIFIED (-1)
+#ifdef ENFILE
+#undef FASTOS_ENFILE_VERIFIED
+#define FASTOS_ENFILE_VERIFIED ENFILE
#endif