Reducing significantly build warning on MacOS

OpenGL deprecated APIs, gl/gl3 inclusion, OpenAL deprecated API.
Implementing process path for the crash reporter.
This commit is contained in:
David Carlier 2020-01-12 07:21:49 +00:00
parent 5ce95ba5e7
commit 7951d1a92d
15 changed files with 32 additions and 30 deletions

View File

@ -7,6 +7,7 @@
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_OPENGL_
#define GL_SILENCE_DEPRECATION
#include "EDriverFeatures.h"
#include "irrTypes.h"

View File

@ -20,6 +20,7 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#if defined(_IRR_OSX_PLATFORM_)
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>

View File

@ -18,6 +18,7 @@
#include <windows.h>
#include <GL/gl.h>
#elif defined(_IRR_OSX_PLATFORM_)
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#define NO_SDL_GLEXT

View File

@ -25,6 +25,7 @@
#pragma comment(lib, "OpenGL32.lib")
#endif
#elif defined(_IRR_OSX_PLATFORM_)
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#define NO_SDL_GLEXT

View File

@ -24,6 +24,7 @@
#ifdef ENABLE_SOUND
# ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# else

View File

@ -21,11 +21,6 @@
#include "audio/music_ogg.hpp"
#include <stdexcept>
#ifdef __APPLE__
# include <OpenAL/al.h>
#else
# include <AL/al.h>
#endif
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"

View File

@ -34,6 +34,7 @@
#endif
#ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
#else
# include <AL/al.h>

View File

@ -27,13 +27,6 @@
#ifdef ENABLE_SOUND
# include <vorbis/codec.h>
# include <vorbis/vorbisfile.h>
# ifdef __APPLE__
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# else
# include <AL/al.h>
# include <AL/alc.h>
# endif
#endif
//----------------------------------------------------------------------------

View File

@ -21,9 +21,12 @@
#ifdef ENABLE_SOUND
# ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# else
# include <AL/al.h>
# include <AL/alc.h>
# endif
#else
typedef unsigned int ALuint;

View File

@ -38,16 +38,6 @@
#include <limits>
#include <math.h>
#ifdef ENABLE_SOUND
# ifdef __APPLE__
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# else
# include <AL/al.h>
# include <AL/alc.h>
# 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

View File

@ -31,9 +31,12 @@
#ifdef ENABLE_SOUND
# ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# else
# include <AL/al.h>
# include <AL/alc.h>
# endif
#else
typedef unsigned int ALuint;

View File

@ -27,12 +27,6 @@
#include "modes/world.hpp"
#include "utils/vs.hpp"
#ifdef __APPLE__
# include <OpenAL/al.h>
#else
# include <AL/al.h>
#endif
#include <assert.h>
#include <cmath>
#include <stdio.h>

View File

@ -23,6 +23,7 @@
#include <assert.h>
#ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
#else
# include <AL/al.h>

View File

@ -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 <GL/glew.h>
# include <GL/glew.h>
// 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 <cinttypes>

View File

@ -342,6 +342,10 @@
#include <execinfo.h>
#include <bfd.h>
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
#if defined(__FreeBSD__)
#include <sys/sysctl.h>
#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);