Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ include(CheckTypeSize)
check_type_size("int" SIZE_INT LANGUAGE C)
check_type_size("size_t" SIZE_SIZET LANGUAGE C)

add_compile_options(-include ${CMAKE_CURRENT_BINARY_DIR}/src/BSLConfig.h)

if(BUILD_TESTING)
if(TEST_MEMCHECK)
find_program(MEMCHECK_CMD valgrind)
Expand Down
2 changes: 2 additions & 0 deletions src/BPSecLib_Public.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <stddef.h>
#include <stdint.h>

#include "BSLConfig.h"

/// This annotation on a function requires the caller to capture and inspect the return value.
#if defined(__GNUC__) || defined(__clang__)
#define BSL_REQUIRE_CHECK __attribute__((warn_unused_result))
Expand Down
4 changes: 4 additions & 0 deletions src/BSLConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,23 @@ const char * bsl_version(void);
/** Define to override value/struct allocation.
* See m-core.h for details.
*/
#undef M_MEMORY_ALLOC
#define M_MEMORY_ALLOC(type) BSL_MALLOC(sizeof(type));
/** Define to override value/struct deallocation.
* See m-core.h for details.
*/
#undef M_MEMORY_DEL
#define M_MEMORY_DEL(ptr) BSL_FREE(ptr);

/** Define to override array allocation.
* See m-core.h for details.
*/
#undef M_MEMORY_REALLOC
#define M_MEMORY_REALLOC(type, ptr, n) (M_UNLIKELY((n) > SIZE_MAX / sizeof(type)) ? NULL : BSL_REALLOC((ptr), (n)*sizeof (type)))
/** Define to override array deallocation.
* See m-core.h for details.
*/
#undef M_MEMORY_FREE
#define M_MEMORY_FREE(ptr) BSL_FREE(ptr);

/** Whether this was built for RTEMS/LEON (instead of Ubuntu/x86)
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ set(BSL_DYNAMIC_C
)

add_library(bsl_dynamic)
add_compile_options(-include ${CMAKE_CURRENT_BINARY_DIR}/BSLConfig.h)
target_sources(bsl_dynamic PUBLIC ${BSL_DYNAMIC_H})
target_sources(bsl_dynamic PRIVATE ${BSL_DYNAMIC_C})
set_target_properties(bsl_dynamic
Expand Down