X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fwimlib%2Ftypes.h;h=e838e7fc2a01aebde625c35aa84c95c86b44160c;hb=c5e4bd4c75bf1f1e8c75c460853340a15917d55c;hp=ac67cf4a9a810b0fd7b0a34bc7e1f2c7340c4de9;hpb=dac0e9d1b28c8c59e6cd1f35dfe71e163dc73bb1;p=wimlib diff --git a/include/wimlib/types.h b/include/wimlib/types.h index ac67cf4a..e838e7fc 100644 --- a/include/wimlib/types.h +++ b/include/wimlib/types.h @@ -1,13 +1,13 @@ #ifndef _WIMLIB_TYPES_H #define _WIMLIB_TYPES_H -#include "wimlib_tchar.h" -#include "wimlib/compiler.h" - #include #include #include +#include "wimlib_tchar.h" +#include "wimlib/compiler.h" + #ifndef _NTFS_TYPES_H /* Unsigned integer types of exact size in bits */ typedef uint8_t u8; @@ -47,4 +47,13 @@ typedef struct WIMStruct WIMStruct; # define WIMLIB_WIMSTRUCT_DECLARED #endif -#endif +/* + * Type of a machine word. 'unsigned long' would be logical, but that is only + * 32 bits on x86_64 Windows. The same applies to 'uint_fast32_t'. So the best + * we can do without a bunch of #ifdefs appears to be 'size_t'. + */ +typedef size_t machine_word_t; + +#define WORDSIZE sizeof(machine_word_t) + +#endif /* _WIMLIB_TYPES_H */