]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
fix macro parameters
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 206688f4af0f87605d0b71b87c88094e783ef660..1e0544667b6a54628ee7e379589b3180655ba671 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -300,7 +300,7 @@ void  util_meminfo       ();
 bool  util_filexists     (const char *);
 bool  util_strupper      (const char *);
 bool  util_strdigit      (const char *);
-char *util_strdup        (const char *);
+char *_util_Estrdup        (const char *, const char *, size_t);
 void  util_debug         (const char *, const char *, ...);
 void  util_endianswap    (void *,  size_t, unsigned int);
 
@@ -317,15 +317,19 @@ int util_asprintf (char **ret, const char *fmt, ...);
 
 
 #ifdef NOTRACK
-#    define mem_a(x)    malloc (x)
-#    define mem_d(x)    free   ((void*)x)
-#    define mem_r(x, n) realloc((void*)x, n)
+#    define mem_a(x)      malloc (x)
+#    define mem_d(x)      free   ((void*)x)
+#    define mem_r(x, n)   realloc((void*)x, n)
+#    define mem_af(x,f,l) malloc (x)
 #else
-#    define mem_a(x)    util_memory_a((x), __LINE__, __FILE__)
-#    define mem_d(x)    util_memory_d((void*)(x))
-#    define mem_r(x, n) util_memory_r((void*)(x), (n), __LINE__, __FILE__)
+#    define mem_a(x)      util_memory_a((x), __LINE__, __FILE__)
+#    define mem_d(x)      util_memory_d((void*)(x))
+#    define mem_r(x, n)   util_memory_r((void*)(x), (n), __LINE__, __FILE__)
+#    define mem_af(x,f,l) util_memory_a((x), __LINE__, __FILE__)
 #endif /*! NOTRACK */
 
+#define util_strdup(X)  _util_Estrdup((X), __FILE__, __LINE__)
+
 /*
  * A flexible vector implementation: all vector pointers contain some
  * data about themselfs exactly - sizeof(vector_t) behind the pointer
@@ -466,10 +470,8 @@ void        util_hsdel(hash_set_t *);
 void           fs_file_close  (FILE *);
 int            fs_file_error  (FILE *);
 int            fs_file_getc   (FILE *);
-int            fs_file_flush  (FILE *);
 int            fs_file_printf (FILE *, const char *, ...);
 int            fs_file_puts   (FILE *, const char *);
-int            fs_file_putc   (FILE *, int);
 int            fs_file_seek   (FILE *, long int, int);
 long int       fs_file_tell   (FILE *); 
 
@@ -480,11 +482,10 @@ FILE          *fs_file_open   (const char *, const char *);
 int            fs_file_getline(char  **, size_t *, FILE *);
 
 /* directory handling */
+int            fs_dir_make    (const char *);
 DIR           *fs_dir_open    (const char *);
 int            fs_dir_close   (DIR *);
 struct dirent *fs_dir_read    (DIR *);
-int            fs_dir_make    (const char *);
-int            fs_dir_change  (const char *);
 
 
 /*===================================================================*/
@@ -1192,6 +1193,7 @@ typedef struct {
     uint32_t     warn_backup  [1 + (COUNT_WARNINGS      / 32)];
     uint32_t     werror_backup[1 + (COUNT_WARNINGS      / 32)];
     uint32_t     optimization [1 + (COUNT_OPTIMIZATIONS / 32)];
+    bool         optimizeoff; /* True when -O0 */
 } opts_cmd_t;
 
 extern opts_cmd_t opts;