Browse Source

Fix OSX build, part1

tags/1.9.4
falkTX 10 years ago
parent
commit
ff5368eb7b
2 changed files with 30 additions and 19 deletions
  1. +21
    -10
      source/modules/dgl/Base.hpp
  2. +9
    -9
      source/modules/distrho/src/DistrhoDefines.h

+ 21
- 10
source/modules/dgl/Base.hpp View File

@@ -17,35 +17,44 @@
#ifndef DGL_BASE_HPP_INCLUDED #ifndef DGL_BASE_HPP_INCLUDED
#define DGL_BASE_HPP_INCLUDED #define DGL_BASE_HPP_INCLUDED


/* Compatibility with non-clang compilers */
#ifndef __has_feature
# define __has_feature(x) 0
#endif
#ifndef __has_extension
# define __has_extension __has_feature
#endif

/* Check OS */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define DGL_OS_WINDOWS 1 # define DGL_OS_WINDOWS 1
#elif defined(__APPLE__) #elif defined(__APPLE__)
# define DGL_OS_MAC 1 # define DGL_OS_MAC 1
#elif defined(__HAIKU__) #elif defined(__HAIKU__)
# define DGL_OS_HAIKU 1 # define DGL_OS_HAIKU 1
#elif defined(__linux__)
#elif defined(__linux__) || defined(__linux)
# define DGL_OS_LINUX 1 # define DGL_OS_LINUX 1
#endif #endif


/* Check for C++11 support */
#if defined(HAVE_CPP11_SUPPORT) #if defined(HAVE_CPP11_SUPPORT)
# define PROPER_CPP11_SUPPORT # define PROPER_CPP11_SUPPORT
#elif defined(__GNUC__) && (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
# define PROPER_CPP11_SUPPORT
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407
# define override // gcc4.7+ only
# endif
#elif __cplusplus >= 201103L || (defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405) || __has_extension(cxx_noexcept)
# define CARLA_PROPER_CPP11_SUPPORT
# if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || ! __has_extension(cxx_override_control)
# define override // gcc4.7+ only
# define final // gcc4.7+ only
# endif # endif
#endif #endif


#ifndef PROPER_CPP11_SUPPORT #ifndef PROPER_CPP11_SUPPORT
# ifndef __clang__
# define noexcept throw()
# endif
# define noexcept throw()
# define override # define override
# define final
# define nullptr (0) # define nullptr (0)
#endif #endif


/* Define namespace */
#ifndef DGL_NAMESPACE #ifndef DGL_NAMESPACE
# define DGL_NAMESPACE DGL # define DGL_NAMESPACE DGL
#endif #endif
@@ -54,12 +63,14 @@
#define END_NAMESPACE_DGL } #define END_NAMESPACE_DGL }
#define USE_NAMESPACE_DGL using namespace DGL_NAMESPACE; #define USE_NAMESPACE_DGL using namespace DGL_NAMESPACE;


/* GL includes */
#ifdef DGL_OS_MAC #ifdef DGL_OS_MAC
# include <OpenGL/gl.h> # include <OpenGL/gl.h>
#else #else
# include <GL/gl.h> # include <GL/gl.h>
#endif #endif


/* missing GL defines */
#if defined(GL_BGR_EXT) && ! defined(GL_BGR) #if defined(GL_BGR_EXT) && ! defined(GL_BGR)
# define GL_BGR GL_BGR_EXT # define GL_BGR GL_BGR_EXT
#endif #endif


+ 9
- 9
source/modules/distrho/src/DistrhoDefines.h View File

@@ -77,25 +77,25 @@
# define DISTRHO_DLL_EXTENSION "so" # define DISTRHO_DLL_EXTENSION "so"
#endif #endif


/* Check for C++11 support */
#if defined(HAVE_CPP11_SUPPORT) #if defined(HAVE_CPP11_SUPPORT)
# define PROPER_CPP11_SUPPORT # define PROPER_CPP11_SUPPORT
#elif defined(__GNUC__) && (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
# define PROPER_CPP11_SUPPORT
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407
# define override // gcc4.7+ only
# endif
#elif __cplusplus >= 201103L || (defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405) || __has_extension(cxx_noexcept)
# define CARLA_PROPER_CPP11_SUPPORT
# if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || ! __has_extension(cxx_override_control)
# define override // gcc4.7+ only
# define final // gcc4.7+ only
# endif # endif
#endif #endif


#ifndef PROPER_CPP11_SUPPORT #ifndef PROPER_CPP11_SUPPORT
# ifndef __clang__
# define noexcept throw()
# endif
# define noexcept throw()
# define override # define override
# define final
# define nullptr (0) # define nullptr (0)
#endif #endif


/* Define namespace */
#ifndef DISTRHO_NO_NAMESPACE #ifndef DISTRHO_NO_NAMESPACE
# ifndef DISTRHO_NAMESPACE # ifndef DISTRHO_NAMESPACE
# define DISTRHO_NAMESPACE DISTRHO # define DISTRHO_NAMESPACE DISTRHO


Loading…
Cancel
Save