Skip to content

Commit 217a177

Browse files
authored
Fixes #204 with support for compiling with -fvisibility=hidden (#205)
1 parent 6ceb5d2 commit 217a177

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

test/inc/platform/icd_test_log.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
#ifndef _ICD_TEST_LOG_H_
22
#define _ICD_TEST_LOG_H_
33

4-
#if defined (_WIN32)
5-
#define DllExport __declspec( dllexport )
4+
#if defined(_WIN32) || defined(__CYGWIN__)
5+
#define DllExport __declspec(dllexport)
66
#else
7-
#define DllExport
7+
#ifndef __has_attribute
8+
#define __has_attribute(x) 0 // Compatibility with non-clang compilers.
9+
#endif
10+
#if (defined(__GNUC__) && (__GNUC__ >= 4)) ||\
11+
(defined(__clang__) && __has_attribute(visibility))
12+
#define DllExport __attribute__((visibility("default")))
13+
#else
14+
#define DllExport
15+
#endif
816
#endif
917

1018
DllExport int test_icd_initialize_app_log(void);

0 commit comments

Comments
 (0)