LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
platforms.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_PLATFORMS_H
16
#define LIEF_PLATFORMS_H
17
18
#if defined(__APPLE__)
19
#include "TargetConditionals.h"
20
#endif
21
22
#if defined(__linux__)
23
#include <features.h>
24
25
#ifndef __GLIBC__
26
#define LIEF_PLATFORM_MUSL 1
27
#else
28
#define LIEF_PLATFORM_GLIBC 1
29
#endif
30
#endif
31
32
namespace
LIEF
{
33
34
enum
PLATFORMS
{
35
PLAT_UNKNOWN
= 0,
36
PLAT_LINUX
,
37
PLAT_ANDROID
,
38
PLAT_WINDOWS
,
39
PLAT_IOS
,
40
PLAT_OSX
,
41
};
42
43
constexpr
PLATFORMS
current_platform
() {
44
#if defined(__ANDROID__)
45
return
PLATFORMS::PLAT_ANDROID
;
46
#elif defined(__linux__)
47
return
PLATFORMS::PLAT_LINUX
;
48
#elif defined(_WIN64) || defined(_WIN32)
49
return
PLATFORMS::PLAT_WINDOWS
;
50
#elif defined(__APPLE__)
51
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
52
return
PLATFORMS::PLAT_IOS
;
53
#else
54
return
PLATFORMS::PLAT_OSX
;
55
#endif
56
#else
57
return
PLATFORMS::PLAT_UNKNOWN
;
58
#endif
59
}
60
61
62
}
63
64
#endif
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
LIEF::current_platform
constexpr PLATFORMS current_platform()
Definition
platforms.hpp:43
LIEF::PLATFORMS
PLATFORMS
Definition
platforms.hpp:34
LIEF::PLAT_OSX
@ PLAT_OSX
Definition
platforms.hpp:40
LIEF::PLAT_ANDROID
@ PLAT_ANDROID
Definition
platforms.hpp:37
LIEF::PLAT_LINUX
@ PLAT_LINUX
Definition
platforms.hpp:36
LIEF::PLAT_UNKNOWN
@ PLAT_UNKNOWN
Definition
platforms.hpp:35
LIEF::PLAT_IOS
@ PLAT_IOS
Definition
platforms.hpp:39
LIEF::PLAT_WINDOWS
@ PLAT_WINDOWS
Definition
platforms.hpp:38
Generated by
1.19.0