diff --git a/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h b/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h index 319b1329a..9bd4c6663 100644 --- a/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h +++ b/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h @@ -7,6 +7,7 @@ #include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ +#define GL_SILENCE_DEPRECATION #include "EDriverFeatures.h" #include "irrTypes.h" diff --git a/lib/irrlicht/source/Irrlicht/COpenGLSLMaterialRenderer.h b/lib/irrlicht/source/Irrlicht/COpenGLSLMaterialRenderer.h index ff711502c..f34033bf1 100644 --- a/lib/irrlicht/source/Irrlicht/COpenGLSLMaterialRenderer.h +++ b/lib/irrlicht/source/Irrlicht/COpenGLSLMaterialRenderer.h @@ -20,6 +20,7 @@ #define GL_GLEXT_PROTOTYPES 1 #endif #if defined(_IRR_OSX_PLATFORM_) + #define GL_SILENCE_DEPRECATION #include #else #include diff --git a/lib/irrlicht/source/Irrlicht/COpenGLShaderMaterialRenderer.h b/lib/irrlicht/source/Irrlicht/COpenGLShaderMaterialRenderer.h index 6f5f58090..bea7cda46 100644 --- a/lib/irrlicht/source/Irrlicht/COpenGLShaderMaterialRenderer.h +++ b/lib/irrlicht/source/Irrlicht/COpenGLShaderMaterialRenderer.h @@ -18,6 +18,7 @@ #include #include #elif defined(_IRR_OSX_PLATFORM_) + #define GL_SILENCE_DEPRECATION #include #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) #define NO_SDL_GLEXT diff --git a/lib/irrlicht/source/Irrlicht/COpenGLTexture.h b/lib/irrlicht/source/Irrlicht/COpenGLTexture.h index 64f6464da..ee0382037 100644 --- a/lib/irrlicht/source/Irrlicht/COpenGLTexture.h +++ b/lib/irrlicht/source/Irrlicht/COpenGLTexture.h @@ -25,6 +25,7 @@ #pragma comment(lib, "OpenGL32.lib") #endif #elif defined(_IRR_OSX_PLATFORM_) + #define GL_SILENCE_DEPRECATION #include #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) #define NO_SDL_GLEXT diff --git a/src/audio/music_manager.cpp b/src/audio/music_manager.cpp index 8c1699d50..2db4623dc 100644 --- a/src/audio/music_manager.cpp +++ b/src/audio/music_manager.cpp @@ -24,6 +24,7 @@ #ifdef ENABLE_SOUND # ifdef __APPLE__ +# define OPENAL_DEPRECATED # include # include # else diff --git a/src/audio/music_ogg.cpp b/src/audio/music_ogg.cpp index 08bb59d75..37df4b46c 100644 --- a/src/audio/music_ogg.cpp +++ b/src/audio/music_ogg.cpp @@ -21,11 +21,6 @@ #include "audio/music_ogg.hpp" #include -#ifdef __APPLE__ -# include -#else -# include -#endif #include "audio/music_manager.hpp" #include "audio/sfx_manager.hpp" diff --git a/src/audio/music_ogg.hpp b/src/audio/music_ogg.hpp index 9b48a9931..a94786f26 100644 --- a/src/audio/music_ogg.hpp +++ b/src/audio/music_ogg.hpp @@ -34,6 +34,7 @@ #endif #ifdef __APPLE__ +# define OPENAL_DEPRECATED # include #else # include diff --git a/src/audio/sfx_buffer.cpp b/src/audio/sfx_buffer.cpp index 756563f49..1c7bb196b 100644 --- a/src/audio/sfx_buffer.cpp +++ b/src/audio/sfx_buffer.cpp @@ -27,13 +27,6 @@ #ifdef ENABLE_SOUND # include # include -# ifdef __APPLE__ -# include -# include -# else -# include -# include -# endif #endif //---------------------------------------------------------------------------- diff --git a/src/audio/sfx_buffer.hpp b/src/audio/sfx_buffer.hpp index bb8c62a16..46507761f 100644 --- a/src/audio/sfx_buffer.hpp +++ b/src/audio/sfx_buffer.hpp @@ -21,9 +21,12 @@ #ifdef ENABLE_SOUND # ifdef __APPLE__ +# define OPENAL_DEPRECATED # include +# include # else # include +# include # endif #else typedef unsigned int ALuint; diff --git a/src/audio/sfx_manager.cpp b/src/audio/sfx_manager.cpp index f5a7e408c..d466f0a65 100644 --- a/src/audio/sfx_manager.cpp +++ b/src/audio/sfx_manager.cpp @@ -38,16 +38,6 @@ #include #include -#ifdef ENABLE_SOUND -# ifdef __APPLE__ -# include -# include -# else -# include -# include -# endif -#endif - // Define this if the profiler should also collect data of the sfx manager #undef ENABLE_PROFILING_FOR_SFX_MANAGER #ifndef ENABLE_PROFILING_FOR_SFX_MANAGER diff --git a/src/audio/sfx_manager.hpp b/src/audio/sfx_manager.hpp index 7ff867d20..200e35b28 100644 --- a/src/audio/sfx_manager.hpp +++ b/src/audio/sfx_manager.hpp @@ -31,9 +31,12 @@ #ifdef ENABLE_SOUND # ifdef __APPLE__ +# define OPENAL_DEPRECATED # include +# include # else # include +# include # endif #else typedef unsigned int ALuint; diff --git a/src/audio/sfx_openal.cpp b/src/audio/sfx_openal.cpp index 28d79b12c..362a23aa6 100644 --- a/src/audio/sfx_openal.cpp +++ b/src/audio/sfx_openal.cpp @@ -27,12 +27,6 @@ #include "modes/world.hpp" #include "utils/vs.hpp" -#ifdef __APPLE__ -# include -#else -# include -#endif - #include #include #include diff --git a/src/audio/sfx_openal.hpp b/src/audio/sfx_openal.hpp index 32f948451..85e5edb50 100644 --- a/src/audio/sfx_openal.hpp +++ b/src/audio/sfx_openal.hpp @@ -23,6 +23,7 @@ #include #ifdef __APPLE__ +# define OPENAL_DEPRECATED # include #else # include diff --git a/src/graphics/gl_headers.hpp b/src/graphics/gl_headers.hpp index c3bee162d..06b7206cb 100644 --- a/src/graphics/gl_headers.hpp +++ b/src/graphics/gl_headers.hpp @@ -23,11 +23,15 @@ #define GLEW_STATIC extern "C" { +#if defined(__APPLE__) +# define GL_SILENCE_DEPRECATION +# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED +#endif #if !defined(USE_GLES2) -# include +# include // This is a workaround for mesa drivers that now use __gl_glext_h_ instead of // __glext_h_ in header file which is not defined in current glew version -# define __gl_glext_h_ +# define __gl_glext_h_ #endif } #include diff --git a/src/utils/crash_reporting.cpp b/src/utils/crash_reporting.cpp index d2b414d0f..b86ba9769 100644 --- a/src/utils/crash_reporting.cpp +++ b/src/utils/crash_reporting.cpp @@ -342,6 +342,10 @@ #include #include + #if defined(__APPLE__) + #include + #endif + #if defined(__FreeBSD__) #include #endif @@ -418,6 +422,14 @@ char *path = NULL; #if defined(__linux__) path = realpath("/proc/self/exe", NULL); +#elif defined(__APPLE__) + path = (char*)malloc(PATH_MAX+1); + uint32_t len = PATH_MAX; + if (_NSGetExecutablePath(path, &len) != 0) { + free((void*)path); + return; + } + path[len] = 0; #elif defined(__FreeBSD__) int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; size_t len = PATH_MAX; @@ -426,6 +438,7 @@ free((void*)path); return; } + path[len] = 0; #endif m_stk_bfd = bfd_openr(path, NULL); free((void*)path);