[misc] fix XP compatibility

* MinGW's gcc 4.9.2 seems to implement a broken "%lld" format 64 bit integer is
  followed by more variables and the app executes on XP => use PRI macros
* Also fix partition ID being ignored when using Rufus MBR
* Also fix some global vars shadowing and add other improvements
This commit is contained in:
Pete Batard 2015-01-28 23:22:11 +00:00
parent 5638519ca0
commit b830c040d2
10 changed files with 48 additions and 45 deletions

View file

@ -220,7 +220,7 @@ static __inline uint64_t bswap_64(uint64_t x)
#elif defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN
# define BB_BIG_ENDIAN 0
# define BB_LITTLE_ENDIAN 1
#elif defined(__386__) || defined(_M_IX86) || defined(_M_AMD64)
#elif defined(__386__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
# define BB_BIG_ENDIAN 0
# define BB_LITTLE_ENDIAN 1
#else
@ -292,7 +292,7 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
/* ---- Size-saving "small" ints (arch-dependent) ----------- */
#if defined(i386) || defined(__x86_64__) || defined(__mips__) || defined(__cris__)
#if defined(__386__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__mips__) || defined(__cris__)
/* add other arches which benefit from this... */
typedef signed char smallint;
typedef unsigned char smalluint;