Began adding float support
[fw/sdcc] / src / SDCCglobl.h
index 4b9e21cc4cbb511b2daf9377cd46ab623ba74834..8be1ab06afcd6da688d1a15330c44881f40d11e4 100644 (file)
@@ -9,6 +9,13 @@
 #include "sdccconf.h"
 #include "SDCCerr.h"
 
+#ifdef __BORLANDC__
+#define NATIVE_WIN32           1
+#endif
+#ifdef __MINGW32__
+#define NATIVE_WIN32           1
+#endif
+
 #ifdef _NO_GC
 
 #define GC_malloc malloc
@@ -163,11 +170,17 @@ struct optimize {
     unsigned    noLoopReverse :1;
 } ;
 
+/* Values for options.model. */
+#define MODEL_SMALL    0
+#define MODEL_LARGE    1
+#define MODEL_FLAT24   2
+
 /* other command line options */
 struct options {
-    int model  : 1     ; /* LARGE == 1 */
+    int model  : 3     ; /* see MODEL_* defines above */
     int stackAuto : 3  ; /* Stack Automatic  */
     int useXstack : 3  ; /* use Xternal Stack */
+    int stack10bit : 3;  /* use 10 bit stack (flat24 model only) */
     int genericPtr: 1  ; /* use generic pointers */
     int regExtend : 1  ; /* don't use extended registers */
     int dump_raw  : 1  ; /* dump after intermediate code generation */
@@ -187,9 +200,12 @@ struct options {
     int nopeep    : 1  ; /* no peep hole optimization */
     int asmpeep   : 1  ; /* pass inline assembler thru peep hole */
     int debug     : 1  ; /* generate extra debug info */
+    int nodebug          : 1  ; /* Generate no debug info. */
     int stackOnData:1  ; /* stack after data segment  */
     int noregparms: 1  ; /* do not pass parameters in registers */
-    char *peep_file    ; /* additional rules for peep hole */    
+    int c1mode   : 1  ; /* Act like c1 - no pre-proc, asm or link */
+    char *peep_file    ; /* additional rules for peep hole */
+    char *out_name     ; /* Asm output name for c1 mode */
 
     char *calleeSaves[128]; /* list of functions using callee save */
     char *excludeRegs[32] ; /* registers excluded from saving */
@@ -227,4 +243,24 @@ extern struct options options;
 extern int maxInterrupts;
 void parseWithComma (char **,char *) ;
 
+/** Creates a temporary file a'la tmpfile which avoids the bugs
+    in cygwin wrt c:\tmp.
+    Scans, in order: TMP, TEMP, TMPDIR, else uses tmpfile().
+*/
+FILE *tempfile(void);
+
+/** Creates a duplicate of the string 'sz' a'la strdup but using
+    libgc.
+*/
+char *gc_strdup(const char *sz);
+
+/** An assert() macro that will go out through sdcc's error
+    system.
+*/
+#define wassertl(a,s)  ((a) ? 0 : \
+        (werror (E_INTERNAL_ERROR,__FILE__,__LINE__, s), 0))
+
+#define wassert(a)    wassertl(a,"code generator internal error")
+
+
 #endif