Made debugging optional.
[fw/sdcc] / src / SDCCglobl.h
index c4e9c977f914947ce581f1498a1e76c3c1c5b9fa..a0b75c2a62d54708254ab5b762bad95f3d99c364 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
@@ -45,16 +52,16 @@ typedef int bool;
 #endif
 
 /* size's in bytes  */
-#define CHARSIZE    1
-#define SHORTSIZE   1
-#define INTSIZE     2
-#define LONGSIZE    4
-#define PTRSIZE     1
-#define FPTRSIZE    2
-#define GPTRSIZE    3
-#define BITSIZE     1
-#define FLOATSIZE   4
-#define MAXBASESIZE 4
+#define CHARSIZE    port->s.char_size
+#define SHORTSIZE   port->s.short_size
+#define INTSIZE     port->s.int_size
+#define LONGSIZE    port->s.long_size
+#define PTRSIZE     port->s.ptr_size
+#define FPTRSIZE    port->s.fptr_size
+#define GPTRSIZE    port->s.gptr_size
+#define BITSIZE     port->s.bit_size
+#define FLOATSIZE   port->s.float_size
+#define MAXBASESIZE port->s.max_base_size
 
 
 #define PRAGMA_SAVE        "SAVE"
@@ -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 */
@@ -204,60 +220,6 @@ struct options {
     int iram_size      ; /* internal ram size (used only for error checking) */
 } ;
 
-/* Processor specific names */
-typedef struct {
-    /** Target name string, used for --help */
-    const char *target_name;
-    struct {
-       /** Command to run (eg as-z80) */
-       const char *exec_name;
-       /** Arguments for debug mode */
-       const char *debug_opts;
-       /** Arguments for normal assembly mode */
-       const char *plain_opts;
-       /** TRUE if the output file name should be pre-pended to the args */
-       bool requires_output_name;
-    } assembler;
-    struct {
-       /** Command to run (eg link-z80) */
-       const char *exec_name;
-    } linker;
-    /** Basic type sizes */
-    struct {
-       int char_size;
-       int short_size;
-       int int_size;
-       int long_size;
-       int ptr_size;
-       int fptr_size;
-       int gptr_size;
-       int bit_size;
-       int float_size;
-       int max_base_size;
-    } s;
-    struct {
-       /** -1 for grows down (z80), +1 for grows up (mcs51) */
-       int direction;
-       /** Extra overhead when calling between banks */
-       int bank_overhead;
-       /** Extra overhead when the function is an ISR */
-       int isr_overhead;
-       /** Standard overhead for a function call */
-       int call_overhead;
-       /** Initial SP offset */
-       int start_sp;
-    } stack;
-    struct {
-       /** One more than the smallest mul/div operation the processor can do nativley 
-           Eg if the processor has an 8 bit mul, nativebelow is 2 */
-       int nativebelow;
-       
-    } muldiv;
-
-} PROCESSOR_CONSTANTS;
-
-extern const PROCESSOR_CONSTANTS port;
-
 /* forward definition for variables accessed globally */
 extern char *currFname ;
 extern char *srcFileName; /* source file name without the extenstion */
@@ -281,4 +243,10 @@ 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);
+
 #endif