Skip to content

Commit efe2a04

Browse files
Add a single unified OS detection header.
1 parent 1c1ee58 commit efe2a04

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

include/qt_os.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#ifndef QT_OS_H
2+
#define QT_OS_H
3+
4+
// Not all Operating systems listed here are actually supported.
5+
6+
#if defined(__linux__) || defined(QTHREADS_LINUX)
7+
#ifndef QTHREADS_LINUX
8+
#define QTHREADS_LINUX
9+
#endif
10+
11+
#elif defined(__APPLE__) || defined(QTHREADS_APPLE)
12+
#ifndef QTHREADS_APPLE
13+
#define QTHREADS_APPLE
14+
#endif
15+
16+
#elif defined(_WIN32) || defined(QTHREADS_WINDOWS)
17+
#ifndef QTHREADS_WINDOWS
18+
#define QTHREADS_WINDOWS
19+
#endif
20+
21+
#elif defined(__FreeBSD__) || defined(QTHREADS_FREEBSD)
22+
#ifndef QTHREADS_FREEBSD
23+
#define QTHREADS_FREEBSD
24+
#endif
25+
26+
#elif defined(__NetBSD__) || defined(QTHREADS_NETBSD)
27+
#ifndef QTHREADS_NETBSD
28+
#define QTHREADS_NETBSD
29+
#endif
30+
31+
#elif defined(__OpenBSD__) || defined(QTHREADS_OPENBSD)
32+
#ifndef QTHREADS_OPENBSD
33+
#define QTHREADS_OPENBSD
34+
#endif
35+
36+
#elif defined(__DragonFly__) || defined(QTHREADS_DRAGONFLYBSD)
37+
#ifndef QTHREADS_DRAGONFLYBSD
38+
#define QTHREADS_DRAGONFLYBSD
39+
#endif
40+
41+
#elif defined(__sun)
42+
#error "Sun OS not currently supported."
43+
44+
#else
45+
#error "Unrecognized OS"
46+
47+
#endif
48+
49+
#endif

0 commit comments

Comments
 (0)