From ce54daa47145e01b2b6ef6fdb13b28d6f9958933 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Mon, 24 Jun 2013 15:40:44 -0500 Subject: [PATCH] common: Add platform #ifdefs for non-cmake build convenience. The cmake CMakeLists.txt file has logic for including or excluding certain compilation units based on the platform: Windows, Linux or Mac OS X. Other build systems are not as clever, it is convenient to also wrap platform-specifics with #ifdef _WIN32 ... #endif to keep things simple on the build side. --- common/os_posix.cpp | 2 ++ common/os_win32.cpp | 6 +++++- helpers/eglsize.cpp | 3 +++ helpers/eglsize.hpp | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/os_posix.cpp b/common/os_posix.cpp index 9e8580f..967d12e 100644 --- a/common/os_posix.cpp +++ b/common/os_posix.cpp @@ -23,6 +23,7 @@ * **************************************************************************/ +#ifndef _WIN32 #include #include @@ -331,3 +332,4 @@ resetExceptionCallback(void) } /* namespace os */ +#endif // !defined(_WIN32) diff --git a/common/os_win32.cpp b/common/os_win32.cpp index bd4b06d..05a7a46 100644 --- a/common/os_win32.cpp +++ b/common/os_win32.cpp @@ -23,6 +23,8 @@ * **************************************************************************/ +#ifdef _WIN32 + #include #include @@ -172,7 +174,7 @@ int execute(char * const * args) sep = ' '; } - STARTUPINFO startupInfo; + STARTUPINFOA startupInfo; memset(&startupInfo, 0, sizeof(startupInfo)); startupInfo.cb = sizeof(startupInfo); @@ -338,3 +340,5 @@ resetExceptionCallback(void) } /* namespace os */ + +#endif // defined(_WIN32) diff --git a/helpers/eglsize.cpp b/helpers/eglsize.cpp index 4f2dfdc..d288338 100644 --- a/helpers/eglsize.cpp +++ b/helpers/eglsize.cpp @@ -29,6 +29,8 @@ * Auxiliary functions to compute the size of array/blob arguments. */ +#ifndef _WIN32 + #include #include "os_thread.hpp" @@ -214,4 +216,5 @@ _EGLImageKHR_free_image_info(struct image_info *info) delete info; } +#endif // !defined(_WIN32) diff --git a/helpers/eglsize.hpp b/helpers/eglsize.hpp index a2014f6..3da79d1 100644 --- a/helpers/eglsize.hpp +++ b/helpers/eglsize.hpp @@ -32,6 +32,7 @@ #ifndef _EGLSIZE_HPP_ #define _EGLSIZE_HPP_ +#ifndef _WIN32 #include "glimports.hpp" @@ -53,5 +54,6 @@ _EGLImageKHR_get_image_info(GLenum target, EGLImageKHR image); void _EGLImageKHR_free_image_info(struct image_info *info); +#endif // !defined(_WIN32) #endif -- 2.43.0