Renesas / SecureDweet
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-2016 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 #ifdef HAVE_FIPS
00031     #include <cyassl/ctaocrypt/visibility.h>
00032     #define WOLFSSL_API   CYASSL_API
00033     #define WOLFSSL_LOCAL CYASSL_LOCAL
00034 #else
00035 
00036 /* WOLFSSL_API is used for the public API symbols.
00037         It either imports or exports (or does nothing for static builds)
00038 
00039    WOLFSSL_LOCAL is used for non-API symbols (private).
00040 */
00041 
00042 #if defined(BUILDING_WOLFSSL)
00043     #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
00044         #define WOLFSSL_API   __attribute__ ((visibility("default")))
00045         #define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
00046     #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
00047         #define WOLFSSL_API   __global
00048         #define WOLFSSL_LOCAL __hidden
00049     #elif defined(_MSC_VER)
00050         #ifdef WOLFSSL_DLL
00051             #define WOLFSSL_API __declspec(dllexport)
00052         #else
00053             #define WOLFSSL_API
00054         #endif
00055         #define WOLFSSL_LOCAL
00056     #else
00057         #define WOLFSSL_API
00058         #define WOLFSSL_LOCAL
00059     #endif /* HAVE_VISIBILITY */
00060 #else /* BUILDING_WOLFSSL */
00061     #if defined(_MSC_VER)
00062         #ifdef WOLFSSL_DLL
00063             #define WOLFSSL_API __declspec(dllimport)
00064         #else
00065             #define WOLFSSL_API
00066         #endif
00067         #define WOLFSSL_LOCAL
00068     #else
00069         #define WOLFSSL_API
00070         #define WOLFSSL_LOCAL
00071     #endif
00072 #endif /* BUILDING_WOLFSSL */
00073 
00074 #endif /* HAVE_FIPS */
00075 #endif /* WOLF_CRYPT_VISIBILITY_H */
00076 
00077