Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added base library with scl_memmgr implementation.
* scl_memmgr supports both c and c++ memory management.
  malloc, calloc, realloc and free for c.
  new, delete operators for c++.
  (in c++ files scl_memmgr.h should be included last because a macro
   is used to replace new and delete with scl versions. If not included
   last, this would break build.)
  • Loading branch information
davyw committed Feb 27, 2012
commit 82c84e7337cae37be65fe1653007498e76f5bc61
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ include_directories(
${SCL_BINARY_DIR}/include
)

ADD_SUBDIRECTORY(src/base)
ADD_SUBDIRECTORY(src/express)
ADD_SUBDIRECTORY(src/exppp)
ADD_SUBDIRECTORY(src/fedex_plus)
Expand Down
13 changes: 13 additions & 0 deletions include/scl_export.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#ifndef SCL_EXPORT_H
#define SCL_EXPORT_H

/* Import/Export flags for base. */
#ifndef SCL_BASE_EXPORT
# if defined(SCL_BASE_DLL_EXPORTS) && defined(SCL_BASE_DLL_IMPORTS)
# error "Only SCL_BASE_DLL_EXPORTS or SCL_BASE_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_BASE_DLL_EXPORTS)
# define SCL_BASE_EXPORT __declspec(dllexport)
# elif defined(SCL_BASE_DLL_IMPORTS)
# define SCL_BASE_EXPORT __declspec(dllimport)
# else
# define SCL_BASE_EXPORT
# endif
#endif

/* Import/Export flags for express. */
#ifndef SCL_EXPRESS_EXPORT
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
Expand Down
20 changes: 20 additions & 0 deletions src/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

set(SCL_BASE_SOURCES
scl_memmgr.cc
)

include_directories(
${SCL_SOURCE_DIR}/include
)

option(SCL_MEMMGR_ENABLE_CHECKS "Enable scl_memmgr's memory leak detection" OFF)

if(MSVC OR BORLAND)
add_definitions( -DSCL_BASE_DLL_EXPORTS )
endif()

if (${SCL_MEMMGR_ENABLE_CHECKS})
add_definitions( -DSCL_MEMMGR_ENABLE_CHECKS )
endif()

SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
Loading