Skip to content

Commit e7514ae

Browse files
committed
Add platform variable (WINDOWS/MACOS/LINUX/OTHER) matching Processing Java
1 parent 2e91948 commit e7514ae

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,16 @@ static constexpr int OTHER = 0;
12921292
static constexpr int WINDOWS = 1;
12931293
static constexpr int MACOS = 2;
12941294
static constexpr int LINUX = 3;
1295+
// Current platform
1296+
#if defined(_WIN32)
1297+
static constexpr int platform = WINDOWS;
1298+
#elif defined(__APPLE__)
1299+
static constexpr int platform = MACOS;
1300+
#elif defined(__linux__)
1301+
static constexpr int platform = LINUX;
1302+
#else
1303+
static constexpr int platform = OTHER;
1304+
#endif
12951305
// Orientation constants (Android/mobile)
12961306
static constexpr int PORTRAIT = 1;
12971307
static constexpr int LANDSCAPE = 2;

0 commit comments

Comments
 (0)