From 460d3875f52aa9f9864040f43b43da0b7636a45b Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 18 Apr 2015 17:37:52 -0700 Subject: [PATCH] * Platform guards --- include/boo.hpp | 6 +++--- include/mac/CCGLContext.hpp | 2 ++ include/win/CWGLContext.hpp | 8 ++++++++ include/x11/CGLXContext.hpp | 3 ++- src/mac/CCGLContext.cpp | 1 + src/win/CWGLContext.cpp | 4 ++++ src/x11/CGLXContext.cpp | 5 ++++- 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/include/boo.hpp b/include/boo.hpp index 5654fbc..8eba4dc 100644 --- a/include/boo.hpp +++ b/include/boo.hpp @@ -6,10 +6,10 @@ #if defined(_WIN32) #error "No support for WGL" #elif defined(__APPLE__) -#include "CCGLContext.hpp" +#include "mac/CCGLContext.hpp" typedef CCGLContext CGraphicsContext; -#elif __linux__ -#include "CGLXContext.hpp" +#elif defined(__GNUC__) || defined(__clang__) +#include "x11/CGLXContext.hpp" typedef CGLXContext CGraphicsContext; #endif diff --git a/include/mac/CCGLContext.hpp b/include/mac/CCGLContext.hpp index 28b874b..26244ad 100644 --- a/include/mac/CCGLContext.hpp +++ b/include/mac/CCGLContext.hpp @@ -1,6 +1,7 @@ #ifndef CCGLCONTEXT_HPP #define CCGLCONTEXT_HPP +#ifdef __APPLE__ #include "IGraphicsContext.hpp" #include @@ -24,4 +25,5 @@ private: int m_majVersion; }; +#endif // __APPLE__ #endif // CCGLCONTEXT_HPP diff --git a/include/win/CWGLContext.hpp b/include/win/CWGLContext.hpp index e69de29..77bfac5 100644 --- a/include/win/CWGLContext.hpp +++ b/include/win/CWGLContext.hpp @@ -0,0 +1,8 @@ +#ifndef CWGLCONTEXT_HPP +#define CWGLCONTEXT_HPP + +#ifdef _WIN32 + + +#endif // _WIN32 +#endif // CWGLCONTEXT_HPP diff --git a/include/x11/CGLXContext.hpp b/include/x11/CGLXContext.hpp index 3c2fc00..421e093 100644 --- a/include/x11/CGLXContext.hpp +++ b/include/x11/CGLXContext.hpp @@ -1,6 +1,7 @@ #ifndef CGLXCONTEXT_HPP #define CGLXCONTEXT_HPP +#if !defined(__APPLE__) && (defined(__linux__) || defined(BSD)) #include #include @@ -28,5 +29,5 @@ private: }; - +#endif // !defined(__APPLE__) && (defined(__linux__) || defined(BSD)) #endif // CGLXCONTEXT_HPP diff --git a/src/mac/CCGLContext.cpp b/src/mac/CCGLContext.cpp index 04938e3..f4bbc0f 100644 --- a/src/mac/CCGLContext.cpp +++ b/src/mac/CCGLContext.cpp @@ -1,3 +1,4 @@ +#ifdef __APPLE__ #include "CCGLContext.hpp" #include diff --git a/src/win/CWGLContext.cpp b/src/win/CWGLContext.cpp index e69de29..dfdd625 100644 --- a/src/win/CWGLContext.cpp +++ b/src/win/CWGLContext.cpp @@ -0,0 +1,4 @@ +#ifdef _WIN32 +#include "win/CWGLContext.hpp" + +#endif diff --git a/src/x11/CGLXContext.cpp b/src/x11/CGLXContext.cpp index 0e6a6d5..6c42417 100644 --- a/src/x11/CGLXContext.cpp +++ b/src/x11/CGLXContext.cpp @@ -1,4 +1,5 @@ -#include "CGLXContext.hpp" +#if !defined(__APPLE__) && (defined(__linux__) || defined(BSD)) +#include "x11/CGLXContext.hpp" #include CGLXContext::CGLXContext() @@ -53,3 +54,5 @@ int CGLXContext::blueDepth() const { return -1; } + +#endif // !defined(__APPLE__) && (defined(__linux__) || defined(BSD))