]> wimlib.net Git - wimlib/blobdiff - include/wimlib/types.h
Remove sle{16,32,64} types
[wimlib] / include / wimlib / types.h
index ac67cf4a9a810b0fd7b0a34bc7e1f2c7340c4de9..87f4604267cc94865d805847b7139f7747fc7c1c 100644 (file)
@@ -1,13 +1,13 @@
 #ifndef _WIMLIB_TYPES_H
 #define _WIMLIB_TYPES_H
 
-#include "wimlib_tchar.h"
-#include "wimlib/compiler.h"
-
 #include <inttypes.h>
 #include <stdbool.h>
 #include <stddef.h>
 
+#include "wimlib_tchar.h"
+#include "wimlib/compiler.h"
+
 #ifndef _NTFS_TYPES_H
 /* Unsigned integer types of exact size in bits */
 typedef uint8_t  u8;
@@ -26,17 +26,10 @@ typedef uint16_t _bitwise_attr le16;
 typedef uint32_t _bitwise_attr le32;
 typedef uint64_t _bitwise_attr le64;
 
-/* Signed little endian types of exact size (declare as unsigned to avoid sign
- * extension on big-endian architectures) */
-typedef uint16_t _bitwise_attr sle16;
-typedef uint32_t _bitwise_attr sle32;
-typedef uint64_t _bitwise_attr sle64;
-
 /* Unsigned big endian types of exact size */
 typedef uint16_t _bitwise_attr be16;
 typedef uint32_t _bitwise_attr be32;
 typedef uint64_t _bitwise_attr be64;
-
 #endif
 
 /* A pointer to 'utf16lechar' indicates a UTF-16LE encoded string */
@@ -47,4 +40,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 */