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