winpr.h (2234B)
1/** 2 * WinPR: Windows Portable Runtime 3 * 4 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19#ifndef WINPR_H 20#define WINPR_H 21 22#include <winpr/platform.h> 23 24#ifdef WINPR_DLL 25#if defined _WIN32 || defined __CYGWIN__ 26#ifdef WINPR_EXPORTS 27#ifdef __GNUC__ 28#define WINPR_API __attribute__((dllexport)) 29#else 30#define WINPR_API __declspec(dllexport) 31#endif 32#else 33#ifdef __GNUC__ 34#define WINPR_API __attribute__((dllimport)) 35#else 36#define WINPR_API __declspec(dllimport) 37#endif 38#endif 39#else 40#if __GNUC__ >= 4 41#define WINPR_API __attribute__((visibility("default"))) 42#else 43#define WINPR_API 44#endif 45#endif 46#else /* WINPR_DLL */ 47#define WINPR_API 48#endif 49 50#if defined(WIN32) && !defined(__CYGWIN__) 51#define WINPR_DEPRECATED(obj) __declspec(deprecated) obj 52#elif defined(__GNUC__) 53#define WINPR_DEPRECATED(obj) obj __attribute__((deprecated)) 54#else 55#define WINPR_DEPRECATED(obj) obj 56#endif 57 58/* Thread local storage keyword define */ 59#if defined _WIN32 || defined __CYGWIN__ 60#ifdef __GNUC__ 61#define WINPR_TLS __thread 62#else 63#define WINPR_TLS __declspec(thread) 64#endif 65#elif !defined(__IOS__) 66#define WINPR_TLS __thread 67#else 68#warning "Target iOS does not support Thread Local Storage!" 69#warning "Multi Instance support is disabled!" 70#define WINPR_TLS 71#endif 72 73#ifdef _WIN32 74#define INLINE __inline 75#else 76#define INLINE inline 77#endif 78 79WINPR_API void winpr_get_version(int* major, int* minor, int* revision); 80WINPR_API const char* winpr_get_version_string(void); 81WINPR_API const char* winpr_get_build_date(void); 82WINPR_API const char* winpr_get_build_revision(void); 83WINPR_API const char* winpr_get_build_config(void); 84 85#define WINPR_UNUSED(x) (void)(x) 86 87#endif /* WINPR_H */