X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=gmqcc.h;h=2b2fca0e2f8c18ce9c8bed8a0d6203e8a1a09033;hp=6d4d9718fc78f5f8ad4550961211052b4d5e9791;hb=1caf1b3ebef2b73e5440412e6c5964ac592ae129;hpb=eb2a74f7e7968f99f6a9e01de838a900ebd6efe0 diff --git a/gmqcc.h b/gmqcc.h index 6d4d971..2b2fca0 100644 --- 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) 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,7 +470,6 @@ 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_seek (FILE *, long int, int);