1 | /* visibility.h
|
---|
2 | *
|
---|
3 | * Copyright (C) 2006-2015 wolfSSL Inc.
|
---|
4 | *
|
---|
5 | * This file is part of wolfSSL. (formerly known as CyaSSL)
|
---|
6 | *
|
---|
7 | * wolfSSL is free software; you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation; either version 2 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * wolfSSL is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with this program; if not, write to the Free Software
|
---|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
20 | */
|
---|
21 |
|
---|
22 | /* Visibility control macros */
|
---|
23 |
|
---|
24 | #ifndef WOLF_CRYPT_VISIBILITY_H
|
---|
25 | #define WOLF_CRYPT_VISIBILITY_H
|
---|
26 |
|
---|
27 |
|
---|
28 | /* for compatibility and so that fips is using same name of macro @wc_fips */
|
---|
29 | #ifdef HAVE_FIPS
|
---|
30 | #include <cyassl/ctaocrypt/visibility.h>
|
---|
31 | #define WOLFSSL_API CYASSL_API
|
---|
32 | #define WOLFSSL_LOCAL CYASSL_LOCAL
|
---|
33 | #else
|
---|
34 |
|
---|
35 | /* WOLFSSL_API is used for the public API symbols.
|
---|
36 | It either imports or exports (or does nothing for static builds)
|
---|
37 |
|
---|
38 | WOLFSSL_LOCAL is used for non-API symbols (private).
|
---|
39 | */
|
---|
40 |
|
---|
41 | #if defined(BUILDING_WOLFSSL)
|
---|
42 | #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
|
---|
43 | #define WOLFSSL_API __attribute__ ((visibility("default")))
|
---|
44 | #define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
|
---|
45 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
---|
46 | #define WOLFSSL_API __global
|
---|
47 | #define WOLFSSL_LOCAL __hidden
|
---|
48 | #elif defined(_MSC_VER)
|
---|
49 | #ifdef WOLFSSL_DLL
|
---|
50 | #define WOLFSSL_API __declspec(dllexport)
|
---|
51 | #else
|
---|
52 | #define WOLFSSL_API
|
---|
53 | #endif
|
---|
54 | #define WOLFSSL_LOCAL
|
---|
55 | #else
|
---|
56 | #define WOLFSSL_API
|
---|
57 | #define WOLFSSL_LOCAL
|
---|
58 | #endif /* HAVE_VISIBILITY */
|
---|
59 | #else /* BUILDING_WOLFSSL */
|
---|
60 | #if defined(_MSC_VER)
|
---|
61 | #ifdef WOLFSSL_DLL
|
---|
62 | #define WOLFSSL_API __declspec(dllimport)
|
---|
63 | #else
|
---|
64 | #define WOLFSSL_API
|
---|
65 | #endif
|
---|
66 | #define WOLFSSL_LOCAL
|
---|
67 | #else
|
---|
68 | #define WOLFSSL_API
|
---|
69 | #define WOLFSSL_LOCAL
|
---|
70 | #endif
|
---|
71 | #endif /* BUILDING_WOLFSSL */
|
---|
72 |
|
---|
73 | #endif /* HAVE_FIPS */
|
---|
74 | #endif /* WOLF_CRYPT_VISIBILITY_H */
|
---|
75 |
|
---|