idx

C library providing a standard for (non-standard) 64-bit file indexing functions.
git clone git://src.gearsix.net/idx
Log | Files | Refs | Atom | README

idx_t.h (1054B)


      1 #ifndef IDX_T
      2 #define IDX_T
      3 #ifdef __cplusplus
      4 extern "C" {
      5 #endif
      6 
      7 
      8 /* Systems with POSIX support */
      9 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
     10 	#include <unistd.h>
     11 	#define IDX_POSIX
     12 	typedef off_t idx_t;
     13 	
     14 /* Windows... */
     15 #elif defined(_WIN32)
     16 	#define IDX_WIN
     17 	typedef __int64 idx_t;
     18 
     19 /* Unknown system, check if we at least have C99 */
     20 #elif (__STDC_VERSION__ >= 199901L)
     21 	#include <stdint.h>
     22 	#define IDX_UKWNC99
     23 	typedef uint_least64_t idx_t;
     24 
     25 /* Unknown system and either non-standard C or pre-C99!
     26   This limits the `idx.h` to using the standard
     27   library AND being stuck with `unsigned long`,
     28   rendering it fairly pointless.
     29   
     30   If you would like to use `idx.h` anyway, just
     31   remove or comment out the `#error` below.
     32   
     33   That said, if you're on a system with 64-bit
     34   support that idx.h doesn't know about, please
     35   drop an email or submit a patch. */
     36 #else
     37 	#error "System not supported and C std pre-C99."
     38 	#define IDX_UNKW
     39 	typedef unsigned long idx_t;
     40 
     41 #endif
     42 
     43 
     44 #ifdef __cplusplus
     45 }
     46 #endif
     47 #endif /* IDX_T */
     48