Skip to content

Commit e09a700

Browse files
committed
Add OpenBSD support
1 parent 69dd040 commit e09a700

9 files changed

Lines changed: 3080 additions & 2 deletions

File tree

include/ittnotify.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,19 @@ The same ID may not be reused for different instances, unless a previous
9090
# define ITT_OS_FREEBSD 4
9191
#endif /* ITT_OS_FREEBSD */
9292

93+
#ifndef ITT_OS_OPENBSD
94+
# define ITT_OS_OPENBSD 5
95+
#endif /* ITT_OS_OPENBSD */
96+
9397
#ifndef ITT_OS
9498
# if defined WIN32 || defined _WIN32
9599
# define ITT_OS ITT_OS_WIN
96100
# elif defined( __APPLE__ ) && defined( __MACH__ )
97101
# define ITT_OS ITT_OS_MAC
98102
# elif defined( __FreeBSD__ )
99103
# define ITT_OS ITT_OS_FREEBSD
104+
# elif defined( __OpenBSD__)
105+
# define ITT_OS ITT_OS_OPENBSD
100106
# else
101107
# define ITT_OS ITT_OS_LINUX
102108
# endif
@@ -118,13 +124,19 @@ The same ID may not be reused for different instances, unless a previous
118124
# define ITT_PLATFORM_FREEBSD 4
119125
#endif /* ITT_PLATFORM_FREEBSD */
120126

127+
#ifndef ITT_PLATFORM_OPENBSD
128+
# define ITT_PLATFORM_OPENBSD 5
129+
#endif /* ITT_PLATFORM_OPENBSD */
130+
121131
#ifndef ITT_PLATFORM
122132
# if ITT_OS==ITT_OS_WIN
123133
# define ITT_PLATFORM ITT_PLATFORM_WIN
124134
# elif ITT_OS==ITT_OS_MAC
125135
# define ITT_PLATFORM ITT_PLATFORM_MAC
126136
# elif ITT_OS==ITT_OS_FREEBSD
127137
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
138+
# elif ITT_OS==ITT_OS_OPENBSD
139+
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
128140
# else
129141
# define ITT_PLATFORM ITT_PLATFORM_POSIX
130142
# endif

include/legacy/ittnotify.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@
2828
# define ITT_OS_FREEBSD 4
2929
#endif /* ITT_OS_FREEBSD */
3030

31+
#ifndef ITT_OS_OPENBSD
32+
# define ITT_OS_OPENBSD 5
33+
#endif /* ITT_OS_OPENBSD */
34+
3135
#ifndef ITT_OS
3236
# if defined WIN32 || defined _WIN32
3337
# define ITT_OS ITT_OS_WIN
3438
# elif defined( __APPLE__ ) && defined( __MACH__ )
3539
# define ITT_OS ITT_OS_MAC
3640
# elif defined( __FreeBSD__ )
3741
# define ITT_OS ITT_OS_FREEBSD
42+
# elif defined( __OpenBSD__ )
43+
# define ITT_OS ITT_OS_OPENBSD
3844
# else
3945
# define ITT_OS ITT_OS_LINUX
4046
# endif
@@ -56,13 +62,19 @@
5662
# define ITT_PLATFORM_FREEBSD 4
5763
#endif /* ITT_PLATFORM_FREEBSD */
5864

65+
#ifndef ITT_PLATFORM_OPENBSD
66+
# define ITT_PLATFORM_OPENBSD 5
67+
#endif /* ITT_PLATFORM_OPENBSD */
68+
5969
#ifndef ITT_PLATFORM
6070
# if ITT_OS==ITT_OS_WIN
6171
# define ITT_PLATFORM ITT_PLATFORM_WIN
6272
# elif ITT_OS==ITT_OS_MAC
6373
# define ITT_PLATFORM ITT_PLATFORM_MAC
6474
# elif ITT_OS==ITT_OS_FREEBSD
6575
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
76+
# elif ITT_OS==ITT_OS_OPENBSD
77+
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
6678
# else
6779
# define ITT_PLATFORM ITT_PLATFORM_POSIX
6880
# endif

rust/ittapi-sys/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ include!("macos/ittnotify_bindings.rs");
1717
include!("windows/ittnotify_bindings.rs");
1818
#[cfg(target_os = "freebsd")]
1919
include!("freebsd/ittnotify_bindings.rs");
20+
#[cfg(target_os = "openbsd")]
21+
include!("openbsd/ittnotify_bindings.rs");
2022

2123
// The JIT profiling bindings are almost OS-agnostic, but slight differences with `c_uint` vs
2224
// `c_int`, e.g., force us to use separate bindings.
@@ -28,6 +30,8 @@ include!("macos/jitprofiling_bindings.rs");
2830
include!("windows/jitprofiling_bindings.rs");
2931
#[cfg(target_os = "freebsd")]
3032
include!("freebsd/jitprofiling_bindings.rs");
33+
#[cfg(target_os = "openbsd")]
34+
include!("openbsd/jitprofiling_bindings.rs");
3135

3236
// #[link(name = "ittnotify", kind = "static")]
3337
// extern "C" {

0 commit comments

Comments
 (0)