physfs_internal.h
changeset 850 2bc230284fed
parent 845 3f150ffcf50c
child 851 dcfbb779ff40
equal deleted inserted replaced
849:a8638a8e4889 850:2bc230284fed
  1272 #define GOTO_IF_MACRO_MUTEX(c, e, m, g) if (c) { __PHYSFS_setError(e); __PHYSFS_platformReleaseMutex(m); goto g; }
  1272 #define GOTO_IF_MACRO_MUTEX(c, e, m, g) if (c) { __PHYSFS_setError(e); __PHYSFS_platformReleaseMutex(m); goto g; }
  1273 
  1273 
  1274 #define __PHYSFS_ARRAYLEN(x) ( (sizeof (x)) / (sizeof (x[0])) )
  1274 #define __PHYSFS_ARRAYLEN(x) ( (sizeof (x)) / (sizeof (x[0])) )
  1275 
  1275 
  1276 #ifdef __GNUC__
  1276 #ifdef __GNUC__
  1277 #define LONGLONGLITERAL(x) x##LL
  1277 #define __PHYSFS_SI64(x) x##LL
       
  1278 #define __PHYSFS_UI64(x) x##ULL
  1278 #else
  1279 #else
  1279 #define LONGLONGLITERAL(x) x
  1280 #define __PHYSFS_SI64(x) x
       
  1281 #define __PHYSFS_UI64(x) x
  1280 #endif
  1282 #endif
  1281 
  1283 
  1282 /*
  1284 /*
  1283  * Check if a ui64 will fit in the platform's address space.
  1285  * Check if a ui64 will fit in the platform's address space.
  1284  *  The initial sizeof check will optimize this macro out entirely on
  1286  *  The initial sizeof check will optimize this macro out entirely on
  1286  *  return zero or non-zero if the variable will fit in the platform's
  1288  *  return zero or non-zero if the variable will fit in the platform's
  1287  *  size_t, suitable to pass to malloc. This is kinda messy, but effective.
  1289  *  size_t, suitable to pass to malloc. This is kinda messy, but effective.
  1288  */
  1290  */
  1289 #define __PHYSFS_ui64FitsAddressSpace(s) ( \
  1291 #define __PHYSFS_ui64FitsAddressSpace(s) ( \
  1290     (sizeof (PHYSFS_uint64) > sizeof (size_t)) && \
  1292     (sizeof (PHYSFS_uint64) > sizeof (size_t)) && \
  1291     ((s) > (LONGLONGLITERAL(0xFFFFFFFFFFFFFFFF) >> (64-(sizeof(size_t)*8)))) \
  1293     ((s) > (__PHYSFS_UI64(0xFFFFFFFFFFFFFFFF) >> (64-(sizeof(size_t)*8)))) \
  1292 )
  1294 )
  1293 
  1295 
  1294 /*
  1296 /*
  1295  * This is a strcasecmp() or stricmp() replacement that expects both strings
  1297  * This is a strcasecmp() or stricmp() replacement that expects both strings
  1296  *  to be in UTF-8 encoding. It will do "case folding" to decide if the
  1298  *  to be in UTF-8 encoding. It will do "case folding" to decide if the