Skip to content

Commit 840548a

Browse files
committed
Sets default symbol visibility to hidden. Resolves #74
1 parent 7a0a356 commit 840548a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Source/CMake/HelperMethods.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ function(add_common_flags target)
582582
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
583583
# Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
584584
# TODO: Use link-time optimization -flto. Might require non-default linker.
585-
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1)
585+
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1 -fvisibility=hidden -fvisibility-inlines-hidden)
586586

587587
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
588588
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -fno-ms-compatibility)

Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,24 @@ namespace bs
100100
* Thread safe class used for storing total number of memory allocations and deallocations, primarily for statistic
101101
* purposes.
102102
*/
103-
class MemoryCounter
103+
class BS_UTILITY_EXPORT MemoryCounter
104104
{
105105
public:
106-
static BS_UTILITY_EXPORT uint64_t getNumAllocs()
106+
static uint64_t getNumAllocs()
107107
{
108108
return Allocs;
109109
}
110110

111-
static BS_UTILITY_EXPORT uint64_t getNumFrees()
111+
static uint64_t getNumFrees()
112112
{
113113
return Frees;
114114
}
115115

116116
private:
117117
friend class MemoryAllocatorBase;
118118

119-
// Threadlocal data can't be exported, so some magic to make it accessible from MemoryAllocator
120-
static BS_UTILITY_EXPORT void incAllocCount() { ++Allocs; }
121-
static BS_UTILITY_EXPORT void incFreeCount() { ++Frees; }
119+
static void incAllocCount() { ++Allocs; }
120+
static void incFreeCount() { ++Frees; }
122121

123122
static BS_THREADLOCAL uint64_t Allocs;
124123
static BS_THREADLOCAL uint64_t Frees;

0 commit comments

Comments
 (0)