]> Shamusworld >> Repos - rln/blobdiff - rln.h
Fixed bug with iscommon() macro.
[rln] / rln.h
diff --git a/rln.h b/rln.h
index 3d379c7acee1e26c3cf41df9c8ea6f91b6cab951..1c19aaf88753139260ebb2de95b969add959c0f9 100644 (file)
--- a/rln.h
+++ b/rln.h
@@ -16,7 +16,7 @@
 #ifdef WIN32
 //#define _OPEN_FLAGS  _O_BINARY|_O_RDWR
 #define _OPEN_FLAGS  _O_BINARY|_O_RDONLY
-#define _BACKSLASH   '\\'
+#define PATH_DELIMITER   '\\'
 #ifdef _MSC_VER
    #if _MSC_VER > 1000
       #pragma warning(disable:4996)
@@ -38,7 +38,7 @@
 #ifdef __GCCUNIX__
 //#define _OPEN_FLAGS  O_RDWR
 #define _OPEN_FLAGS  O_RDONLY
-#define _BACKSLASH   '/'
+#define PATH_DELIMITER   '/'
 #include <sys/fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -51,7 +51,7 @@
 #endif
 
 #define MAJOR        1                          // Major version number
-#define MINOR        1                          // Minor version number
+#define MINOR        2                          // Minor version number
 #define PATCH        0                          // Patch release number
 
 #ifdef WIN32
@@ -68,9 +68,9 @@
 #define warn(x, f) printf("Warning: repeated flag `%c'%s\n", x, f ? "; previous one(s) ignored." : ".")
 
 // Macro for max: good because longs, shorts, or pointers can be compared
-#ifndef max
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif // max
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
 
 // Macro to swap the 16-bit words of a 32-bit integer
 #define _SWAPWORD(x) (((unsigned)(x) >> 16) | ((unsigned)(x) << 16))
@@ -222,24 +222,29 @@ struct HREC
 #define ABST_DATA       0x0400 /* data-based relocatable */
 #define ABST_TEXT       0x0200 /* text-based relocatable */
 #define ABST_BSS        0x0100 /* bss-based relocatable  */
-#define ABST_FILE       0x0080                  // file symbol
-#define ABST_ARCHIVE    0x0040                  // only when FILE set: archive file or no
-#define ABST_OST        0x0001                  // private: "symbol is in ost": see above
+#define ABST_FILE       0x0080 // file symbol
+#define ABST_ARCHIVE    0x0040 // only when FILE set: archive file or no
+#define ABST_OST        0x0001 // private: "symbol is in ost": see above
 #define T_COMMON       (T_GLOBAL | T_EXTERN)
 #define T_SEG          (T_DATA | T_TEXT | T_BSS)   // segment bits
 
 // Symbol Table - Type Definitions
 
 #define T_UNDF          0x00000000     // Undefined Symbol
-#define T_EXT           0x01000000     // External Bit, OR'ed In
-#define T_ABS           0x02000000     // Absolute Symbol
+#define T_EXT           0x01000000     // External Bit, OR'ed In (Global)
+#define T_ABS           0x02000000     // Absolute Symbol (Equated)
 #define T_TEXT          0x04000000     // TEXT Segment
 #define T_DATA          0x06000000     // DATA Segment
 #define T_BSS           0x08000000     // BSS Segment
 
 // These macros are used with the TYPE field of a SYMBOL.
+/*
+Absolutes (equates) can't be externals (line 434)
+-- they are non-relocatable
+*/
 
-#define iscommon(type) (((type) & T_EXT) == T_EXT)
+//#define iscommon(type) (((type) & T_EXT) == T_EXT)
+#define iscommon(type) (((type) & T_EXT) == 0)
 #define isglobal(type) (((type) & T_EXT) == T_EXT)
 #define isextern(type) (((type) & T_EXT) == T_EXT)
 #define islocal(type)  (((type) & T_EXT) == 0)
@@ -254,9 +259,9 @@ complete, total, and utter failure. :-)
 // This macro is used to compare two symbols for equality. It depends on
 // symcopy remaining as it is (copies two longs plus a null)
 
-//#define symcmp(a,b) ((*(uint32_t *)(a) == *(uint32_t *)(b)) && \
-//                                     (*(uint32_t *)((a) + sizeof(uint32_t)) == \
-//                                     *(uint32_t *)((b) + sizeof(uint32_t))))
+//#define symcmp(a,b) ((*(long *)(a) == *(long *)(b)) && \
+//                                     (*(long *)((a) + sizeof(long)) == \
+//                                     *(long *)((b) + sizeof(long))))
 
 // Function Prototypes
 
@@ -276,3 +281,4 @@ int segmentpad(FILE *, long, int);
 int ost_lookup(char *);
 
 #endif // __RLH_H__
+