diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-20 22:32:31 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-20 22:32:31 +0100 |
commit | 3cb24fff33105f40c2f4b696a06449032ec09604 (patch) | |
tree | 4623802cde42a9debeae4fbd893e66522f1ffb6c | |
parent | c232b2023205b6b898448cb1f603b4d42a7a2656 (diff) | |
download | mariadb-git-3cb24fff33105f40c2f4b696a06449032ec09604.tar.gz |
- 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.
-rw-r--r-- | mysys/CMakeLists.txt | 10 | ||||
-rw-r--r-- | mysys/my_new.cc | 7 |
2 files changed, 7 insertions, 10 deletions
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 329c132a9f1..c565f7f12d5 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -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() diff --git a/mysys/my_new.cc b/mysys/my_new.cc index 8724f9cc4a4..03b3d0f5870 100644 --- a/mysys/my_new.cc +++ b/mysys/my_new.cc @@ -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 */ |