#ifndef DEBUG_MEMORY_IMPLEMENTATION
#define os_malloc( _size ) \
- debug_malloc( __FILE__, __LINE__, __FUNCTION__, _size )
+ debug_malloc( __FILE__, __LINE__, __func__, _size )
#define os_calloc( _count, _size ) \
- debug_calloc(__FILE__, __LINE__, __FUNCTION__, _count, _size )
+ debug_calloc(__FILE__, __LINE__, __func__, _count, _size )
#define os_free( _ptr ) \
- debug_free( __FILE__, __LINE__, __FUNCTION__, _ptr )
+ debug_free( __FILE__, __LINE__, __func__, _ptr )
#define os_realloc( _ptr, _old_size, _new_size ) \
- debug_realloc( __FILE__, __LINE__, __FUNCTION__, _ptr, _old_size, _new_size )
+ debug_realloc( __FILE__, __LINE__, __func__, _ptr, _old_size, _new_size )
/* TODO: wrap os_malloc_aligned() and os_free_aligned() too */
#include "os_memory_aligned.h"
result = dfault;
if (debug_get_option_should_print())
- debug_printf("%s: %s = %s\n", __FUNCTION__, name,
+ debug_printf("%s: %s = %s\n", __func__, name,
result ? result : "(null)");
return result;
{
bool result = debug_get_bool_option_direct(name, dfault);
if (debug_get_option_should_print())
- debug_printf("%s: %s = %s\n", __FUNCTION__, name,
+ debug_printf("%s: %s = %s\n", __func__, name,
result ? "TRUE" : "FALSE");
return result;
}
if (debug_get_option_should_print())
- debug_printf("%s: %s = %li\n", __FUNCTION__, name, result);
+ debug_printf("%s: %s = %li\n", __func__, name, result);
return result;
}
}
if (debug_get_option_should_print())
- debug_printf("%s: %s = %u.%u\n", __FUNCTION__, name, *major, *minor);
+ debug_printf("%s: %s = %u.%u\n", __func__, name, *major, *minor);
return;
}
result = dfault;
else if (!strcmp(str, "help")) {
result = dfault;
- _debug_printf("%s: help for %s:\n", __FUNCTION__, name);
+ _debug_printf("%s: help for %s:\n", __func__, name);
for (; flags->name; ++flags)
namealign = MAX2(namealign, strlen(flags->name));
for (flags = orig; flags->name; ++flags)
if (debug_get_option_should_print()) {
if (str) {
debug_printf("%s: %s = 0x%"PRIx64" (%s)\n",
- __FUNCTION__, name, result, str);
+ __func__, name, result, str);
} else {
- debug_printf("%s: %s = 0x%"PRIx64"\n", __FUNCTION__, name, result);
+ debug_printf("%s: %s = 0x%"PRIx64"\n", __func__, name, result);
}
}
*/
#ifdef DEBUG
#define debug_checkpoint() \
- _debug_printf("%s\n", __FUNCTION__)
+ _debug_printf("%s\n", __func__)
#else
#define debug_checkpoint() \
((void)0)
*/
#ifdef DEBUG
#define debug_checkpoint_full() \
- _debug_printf("%s:%u:%s\n", __FILE__, __LINE__, __FUNCTION__)
+ _debug_printf("%s:%u:%s\n", __FILE__, __LINE__, __func__)
#else
#define debug_checkpoint_full() \
((void)0)
*/
#ifdef DEBUG
#define debug_warning(__msg) \
- _debug_printf("%s:%u:%s: warning: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg)
+ _debug_printf("%s:%u:%s: warning: %s\n", __FILE__, __LINE__, __func__, __msg)
#else
#define debug_warning(__msg) \
((void)0)
static bool warned = false; \
if (!warned) { \
_debug_printf("%s:%u:%s: one time warning: %s\n", \
- __FILE__, __LINE__, __FUNCTION__, __msg); \
+ __FILE__, __LINE__, __func__, __msg); \
warned = true; \
} \
} while (0)
*/
#ifdef DEBUG
#define debug_error(__msg) \
- _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg)
+ _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __func__, __msg)
#else
#define debug_error(__msg) \
_debug_printf("error: %s\n", __msg)
hdr = header_from_data(ptr);
if (hdr->magic != DEBUG_MEMORY_MAGIC) {
- debug_printf("%s corrupted memory at %p\n", __FUNCTION__, ptr);
+ debug_printf("%s corrupted memory at %p\n", __func__, ptr);
assert(0);
}