wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers visibility.h Source File

visibility.h

00001 /* visibility.h
00002  *
00003  * Copyright (C) 2006-2020 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 
00023 /* Visibility control macros */
00024 
00025 #ifndef WOLF_CRYPT_VISIBILITY_H
00026 #define WOLF_CRYPT_VISIBILITY_H
00027 
00028 
00029 /* for compatibility and so that fips is using same name of macro @wc_fips */
00030 /* The following visibility wrappers are for old FIPS. New FIPS should use
00031  * the same as a non-FIPS build. */
00032 #if defined(HAVE_FIPS) && \
00033     (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
00034     #include <cyassl/ctaocrypt/visibility.h>
00035     #define WOLFSSL_API   CYASSL_API
00036     #define WOLFSSL_LOCAL CYASSL_LOCAL
00037 #else
00038 
00039 /* WOLFSSL_API is used for the public API symbols.
00040         It either imports or exports (or does nothing for static builds)
00041 
00042    WOLFSSL_LOCAL is used for non-API symbols (private).
00043 */
00044 
00045 #if defined(BUILDING_WOLFSSL)
00046     #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__)
00047         #if defined(WOLFSSL_DLL)
00048             #define WOLFSSL_API __declspec(dllexport)
00049         #else
00050             #define WOLFSSL_API
00051         #endif
00052         #define WOLFSSL_LOCAL
00053     #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
00054         #define WOLFSSL_API   __attribute__ ((visibility("default")))
00055         #define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
00056     #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
00057         #define WOLFSSL_API   __global
00058         #define WOLFSSL_LOCAL __hidden
00059     #else
00060         #define WOLFSSL_API
00061         #define WOLFSSL_LOCAL
00062     #endif /* HAVE_VISIBILITY */
00063 #else /* BUILDING_WOLFSSL */
00064     #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__)
00065         #if defined(WOLFSSL_DLL)
00066             #define WOLFSSL_API __declspec(dllimport)
00067         #else
00068             #define WOLFSSL_API
00069         #endif
00070         #define WOLFSSL_LOCAL
00071     #else
00072         #define WOLFSSL_API
00073         #define WOLFSSL_LOCAL
00074     #endif
00075 #endif /* BUILDING_WOLFSSL */
00076 
00077 #endif /* HAVE_FIPS */
00078 #endif /* WOLF_CRYPT_VISIBILITY_H */
00079 
00080