wolfssl/wolfcrypt/visibility.h

This commit is contained in:
Kaleb Himes
2014-12-18 11:52:35 -07:00
parent 557e969b3b
commit 0ce0a7b558

View File

@ -2,14 +2,14 @@
* *
* Copyright (C) 2006-2014 wolfSSL Inc. * Copyright (C) 2006-2014 wolfSSL Inc.
* *
* This file is part of CyaSSL. * This file is part of wolfSSL. (formerly known as CyaSSL)
* *
* CyaSSL is free software; you can redistribute it and/or modify * wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CyaSSL is distributed in the hope that it will be useful, * wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -21,62 +21,46 @@
/* Visibility control macros */ /* Visibility control macros */
#if !defined(WOLF_CRYPT_VISIBILITY_H && CTAO_CRYPT_VISIBILITY_H) #ifndef WOLF_CRYPT_VISIBILITY_H
#define WOLF_CRYPT_VISIBILITY_H #define WOLF_CRYPT_VISIBILITY_H
/* CYASSL_API is used for the public API symbols. /* WOLFSSL_API is used for the public API symbols.
It either imports or exports (or does nothing for static builds) It either imports or exports (or does nothing for static builds)
CYASSL_LOCAL is used for non-API symbols (private). WOLFSSL_LOCAL is used for non-API symbols (private).
*/ */
#define BUILDING_WOLFSSL BUILDING_CYASSL
#if defined(BUILDING_WOLFSSL) #if defined(BUILDING_WOLFSSL)
#if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
#define WOLFSSL_API __attribute__ ((visibility("default"))) #define WOLFSSL_API __attribute__ ((visibility("default")))
#define CYASSL_API WOLFSSL_API
#define WOLFSSL_LOCAL __attribute__ ((visibility("hidden"))) #define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
#define CYASSL_LOCAL WOLFSSL_LOCAL
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define WOLFSSL_API __global #define WOLFSSL_API __global
#define CYASSL_API WOLFSSL_API
#define WOLFSSL_LOCAL __hidden #define WOLFSSL_LOCAL __hidden
#define CYASSL_LOCAL WOLFSSL_LOCAL
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define CYASSL_DLL WOLFSSL_DLL
#ifdef WOLFSSL_DLL #ifdef WOLFSSL_DLL
#define WOLFSSL_API extern __declspec(dllexport) #define WOLFSSL_API extern __declspec(dllexport)
#define CYASSL_API WOLFSSL_API
#else #else
//#define CYASSL_API //#define WOLFSSL_API
#define WOLFSSL_API #define WOLFSSL_API:
#define CYASSL_API WOLFSSL_API
#endif #endif
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL
#define CYASSL_LOCAL WOLFSSL_LOCAL
#else #else
#define WOLFSSL_API #define WOLFSSL_API
#define CYASSL_API WOLFSSL_API
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL
#define CYASSL_LOCAL WOLFSSL_LOCAL
#endif /* HAVE_VISIBILITY */ #endif /* HAVE_VISIBILITY */
#else /* BUILDING_CYASSL */ #else /* BUILDING_WOLFSSL */
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define CYASSL_DLL WOLFSSL_DLL
#ifdef WOLFSSL_DLL #ifdef WOLFSSL_DLL
#define WOLFSSL_API extern __declspec(dllimport) #define WOLFSSL_API extern __declspec(dllimport)
#define CYASSL_API WOLFSSL_API
#else #else
#define WOLFSSL_API #define WOLFSSL_API
#define CYASSL_API WOLFSSL_API
#endif #endif
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL
#define CYASSL_LOCAL WOLFSSL_LOCAL
#else #else
#define WOLFSSL_API #define WOLFSSL_API
#define CYASSL_API WOLFSSL_API
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL
#define CYASSL_LOCAL WOLFSSL_LOCAL
#endif #endif
#endif /* BUILDING_WOLFSSL */ #endif /* BUILDING_WOLFSSL */