johnsonjh / duma

duma: Detect Unintended Memory Access (D.U.M.A.) - A Red-Zone memory allocator
https://github.com/johnsonjh/duma
GNU General Public License v2.0
100 stars 10 forks source link

What is DUMA_SO/LIB and is it an error? #187

Closed rsp4jack closed 2 years ago

rsp4jack commented 2 years ago

I find these in CMakeLists.txt:

if (NOT DUMA_SHARED_WITH_CPP_SUPPORT)
  target_compile_definitions(DUMA_SHARED PRIVATE DUMA_SO_NO_CPP_SUPPORT)
endif()
if (NOT DUMA_SHARED_WITH_LEAK_DETECTION)
  target_compile_definitions(DUMA_SHARED PRIVATE DUMA_SO_NO_LEAKDETECTION)
endif()
if (DUMA_SHARED_PREFER_ATEXIT)
  target_compile_definitions(DUMA_SHARED PRIVATE DUMA_SO_PREFER_ATEXIT)
endif()
if (DUMA_SHARED_PREFER_GETENV)
  target_compile_definitions(DUMA_SHARED PRIVATE DUMA_SO_PREFER_GETENV)
endif()
if (DUMA_SHARED_NO_HANG_MSG)
  target_compile_definitions(DUMA_SHARED PRIVATE DUMA_SO_NO_HANG_MSG)
endif()

if (NOT DUMA_WITH_STRERROR)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_NO_STRERROR)
endif()
if (NOT DUMA_WITH_OLD_NEW_MACRO)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_OLD_NEW_MACRO)
endif()
if (NOT DUMA_STATIC_WITH_LEAK_DETECTION)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_LIB_NO_LEAKDETECTION)
endif()
if (DUMA_STATIC_PREFER_ATEXIT)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_LIB_PREFER_ATEXIT)
endif()
if (DUMA_STATIC_PREFER_GETENV)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_LIB_PREFER_GETENV)
endif()
if (DUMA_STATIC_NO_HANG_MSG)
  target_compile_definitions(DUMA_STATIC PRIVATE DUMA_LIB_NO_HANG_MSG)
endif()

But in duma.c:

#ifndef DUMA_PREFER_GETENV
#define DUMA_GETENV duma_getenv
#else
#define DUMA_GETENV getenv
#endif

Is that an error?

rsp4jack commented 2 years ago

It is in duma_config.h