summaryrefslogtreecommitdiff
path: root/external/clcc/clew-non-static.patch
blob: f111930f39288fc0f3308425e33d3f26f0177ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- src/clew.h
+++ src/clew.h
@@ -1141,25 +1141,28 @@
 // calling the returned function address.
 //
 typedef CL_API_ENTRY void * (CL_API_CALL * PFNCLGETEXTENSIONFUNCTIONADDRESS)(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
-
-
-#define CLEW_STATIC
 
 #ifdef CLEW_STATIC
 #  define CLEWAPI extern
 #else
 #  ifdef CLEW_BUILD
-#    define CLEWAPI extern __declspec(dllexport)
+#    if defined(_WIN32)
+#      define CLEWAPI extern __declspec(dllexport)
+#    elif defined(HAVE_GCC_VISIBILITY_FEATURE)
+#      define CLEWAPI extern __attribute__ ((visibility("default")))
+#    else
+#      define CLEWAPI extern
+#    endif
 #  else
-#    define CLEWAPI extern __declspec(dllimport)
+#    if defined(_WIN32)
+#      define CLEWAPI extern __declspec(dllimport)
+#    else
+#      define CLEWAPI extern
+#    endif
 #  endif
 #endif
 
-#if defined(_WIN32)
-#define CLEW_FUN_EXPORT extern
-#else
 #define CLEW_FUN_EXPORT CLEWAPI
-#endif
 
 #define CLEW_GET_FUN(x) x
 
@@ -1305,9 +1305,9 @@
 #define CLEW_ERROR_IMPORT_FAILED    -3      //!<    Error code for failing to import a named function from the dll
 
 //! \brief Load OpenCL dynamic library and set function entry points
-int         clewInit        (const char*);
+CLEW_FUN_EXPORT int         clewInit        (const char*);
 //! \brief Convert an OpenCL error code to its string equivalent
-const char* clewErrorString (cl_int error);
+CLEW_FUN_EXPORT const char* clewErrorString (cl_int error);
 
 #ifdef __cplusplus
 }