summaryrefslogtreecommitdiff
path: root/includes/compiler/CompilerTools.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-12-29 12:32:55 +0000
committerAsh Wolf <ninji@wuffs.org>2022-12-29 12:32:55 +0000
commitfcfbafff31869ed808bff0639532db1828660e92 (patch)
tree7425b346b031c4cb47a06250b3f6f950374d44ae /includes/compiler/CompilerTools.h
parentbc1321735c15104ffad195e1509cab5f3a044260 (diff)
downloadMWCC-fcfbafff31869ed808bff0639532db1828660e92.tar.gz
MWCC-fcfbafff31869ed808bff0639532db1828660e92.zip
dump lots more code
Diffstat (limited to '')
-rw-r--r--includes/compiler/CompilerTools.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/includes/compiler/CompilerTools.h b/includes/compiler/CompilerTools.h
index dbaf7d9..d44d766 100644
--- a/includes/compiler/CompilerTools.h
+++ b/includes/compiler/CompilerTools.h
@@ -40,12 +40,12 @@ typedef struct _HeapInfo {
SInt32 largest_free_block;
} HeapInfo;
-typedef struct GList {
+struct GList {
char **data;
SInt32 size;
SInt32 hndlsize;
SInt32 growsize;
-} GList;
+};
extern long hash_name_id;
extern HashNameNode **name_hash_nodes;
@@ -119,12 +119,17 @@ extern void memclr(void *ptr, SInt32 size);
extern void memclrw(void *ptr, SInt32 size);
extern void CToLowercase(char *a, char *b);
extern short getbit(SInt32 l);
-extern inline SInt32 CTool_EndianReadWord32(void *value) {
- return *((SInt32 *) value);
-}
-extern inline UInt32 CTool_EndianConvertWord32(UInt32 value) {
- return value;
-}
+#ifdef ENDIAN_CONVERSION
+extern UInt16 CTool_EndianConvertWord16(UInt16 theword);
+extern UInt32 CTool_EndianConvertWord32(UInt32 theword);
+extern void CTool_EndianConvertMem(UInt8 *data, short len);
+extern UInt32 CTool_EndianReadWord32(void *ptr);
+#else
+#define CTool_EndianConvertWord32(value) value
+#define CTool_EndianConvertWord16(value) value
+#define CTool_EndianConvertMem(data, len) ((void)0)
+#define CTool_EndianReadWord32(ptr) (*((UInt32 *) (ptr)))
+#endif
extern void CTool_EndianConvertWord64(CInt64 ci, char *result);
extern UInt16 CTool_EndianConvertInPlaceWord16Ptr(UInt16 *x);
extern UInt32 CTool_EndianConvertInPlaceWord32Ptr(UInt32 *x);