Commit 3cb24fff authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

- Always compile my_new.cc and safemalloc.c with mysys

Preprocessor macros USE_MYSYS_NEW and -DSAFEMALLOC are 
used to conditionally compile safemalloc or overwritten new/delete.

-Define dummy symbol in my_new.cc in case -DUSE_MYSYS_NEW is not set.
This avoids compiler/linker warnings about an essentially empty file
being compiled.
parent c232b202
......@@ -34,6 +34,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c
rijndael.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c base64.c my_memmem.c my_getpagesize.c
lf_alloc-pin.c lf_dynarray.c lf_hash.c
safemalloc.c my_new.cc
my_atomic.c my_getncpus.c my_safehash.c my_chmod.c my_rnd.c
my_uuid.c wqueue.c waiting_threads.c ma_dyncol.c
my_rdtsc.c)
......@@ -46,15 +47,6 @@ IF(UNIX)
SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_addr_resolve.c)
ENDIF()
IF(NOT HAVE_CXX_NEW)
ADD_DEFINITIONS( -DUSE_MYSYS_NEW)
SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_new.cc)
ENDIF()
IF(WITH_SAFEMALLOC)
SET (MYSYS_SOURCES ${MYSYS_SOURCES} safemalloc.c)
ENDIF()
IF(HAVE_ALARM)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_alarm.c)
ENDIF()
......
......@@ -55,6 +55,11 @@ int __cxa_pure_virtual()
}
C_MODE_END
#else
/*
Define a dummy symbol, just to avoid compiler/linker warnings
about compiling an essentially empty file.
*/
int my_new_cc_symbol;
#endif /* USE_MYSYS_NEW */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment