OpenVPN 3 Core Library
Loading...
Searching...
No Matches
platform.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// define a TARGET_x macro that describes our build target
13
14#ifndef OPENVPN_COMMON_PLATFORM_H
15#define OPENVPN_COMMON_PLATFORM_H
16
17#if defined(_WIN32)
18#define OPENVPN_PLATFORM_WIN
19#if defined(__cplusplus_winrt)
20#include <winapifamily.h>
21#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
22#define OPENVPN_PLATFORM_UWP
23#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
24#endif // defined(__cplusplus_winrt)
25#elif defined(__FreeBSD__)
26#define OPENVPN_PLATFORM_FREEBSD
27#elif defined(__APPLE__)
28#include "TargetConditionals.h"
29#if TARGET_OS_IPHONE // includes iPad
30#define OPENVPN_PLATFORM_IPHONE
31#define OPENVPN_PLATFORM_IPHONE_DEVICE
32#elif TARGET_IPHONE_SIMULATOR // includes iPad
33#define OPENVPN_PLATFORM_IPHONE
34#define OPENVPN_PLATFORM_IPHONE_SIMULATOR
35#elif TARGET_OS_MAC
36#define OPENVPN_PLATFORM_MAC
37#endif
38#elif defined(__ANDROID__)
39#define OPENVPN_PLATFORM_ANDROID
40#elif defined(__linux__)
41#define OPENVPN_PLATFORM_LINUX
42#endif
43
44#if !defined(_WIN32)
45#define OPENVPN_PLATFORM_TYPE_UNIX
46#endif
47
48#endif // OPENVPN_COMMON_PLATFORM_H