Get rid of various old compiler and platform checks

This commit is contained in:
sfan5
2022-02-26 11:38:43 +01:00
parent 01586f584a
commit df908ef4ea
20 changed files with 34 additions and 214 deletions

View File

@ -15,10 +15,6 @@
#include "SExposedVideoData.h"
#include "IContextManager.h"
#ifdef _MSC_VER
#pragma comment(lib, "libEGL.lib")
#endif
namespace irr
{
namespace video

View File

@ -23,11 +23,9 @@
#endif
#if defined (_IRR_WINDOWS_API_)
#if !defined ( _WIN32_WCE )
#include <direct.h> // for _chdir
#include <io.h> // for _access
#include <tchar.h>
#endif
#include <direct.h> // for _chdir
#include <io.h> // for _access
#include <tchar.h>
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_) || defined(_IRR_IOS_PLATFORM_) || defined(_IRR_ANDROID_PLATFORM_))
#include <stdio.h>
#include <stdlib.h>
@ -797,7 +795,6 @@ IFileList* CFileSystem::createFileList()
// --------------------------------------------
//! Windows version
#ifdef _IRR_WINDOWS_API_
#if !defined ( _WIN32_WCE )
r = new CFileList(Path, true, false);
@ -819,12 +816,7 @@ IFileList* CFileSystem::createFileList()
_findclose( hFile );
}
#endif
//TODO add drives
//entry.Name = "E:\\";
//entry.isDirectory = true;
//Files.push_back(entry);
#endif
// --------------------------------------------

View File

@ -18,9 +18,7 @@
#ifdef _IRR_WINDOWS_API_
#define WIN32_LEAN_AND_MEAN
#if !defined(_IRR_XBOX_PLATFORM_)
#include <windows.h>
#endif
#include <windows.h>
#define _IRR_WINDOWS_NT_CONSOLE_
#else
#include <time.h>

View File

@ -22,20 +22,13 @@
#include "IGUISpriteBank.h"
#include <winuser.h>
#include "SExposedVideoData.h"
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
#include <mmsystem.h>
#include <regstr.h>
#ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#ifdef _MSC_VER
#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dxguid.lib")
#endif
#else
#ifdef _MSC_VER
#pragma comment(lib, "winmm.lib")
#endif
#endif
#endif

View File

@ -13,11 +13,9 @@
#include "IImagePresenter.h"
#define WIN32_LEAN_AND_MEAN
#if !defined(_IRR_XBOX_PLATFORM_)
#include <windows.h>
#include <mmsystem.h> // For JOYCAPS
#include <windowsx.h>
#endif
#include <windows.h>
#include <mmsystem.h> // For JOYCAPS
#include <windowsx.h>
#if !defined(GET_X_LPARAM)
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))

View File

@ -22,10 +22,6 @@
#include "SLight.h"
#include "SExposedVideoData.h"
#ifdef _MSC_VER
#pragma warning( disable: 4996)
#endif
namespace irr
{
namespace io

View File

@ -27,10 +27,6 @@
#include <windows.h>
#endif
#ifdef _MSC_VER
#pragma comment(lib, "libGLESv2.lib")
#endif
namespace irr
{
namespace video

View File

@ -26,10 +26,6 @@
#include <windows.h>
#endif
#ifdef _MSC_VER
#pragma comment(lib, "libGLES_CM.lib")
#endif
namespace irr
{
namespace video

View File

@ -5,9 +5,7 @@
#include "COSOperator.h"
#ifdef _IRR_WINDOWS_API_
#ifndef _IRR_XBOX_PLATFORM_
#include <windows.h>
#endif
#else
#include <string.h>
#include <unistd.h>
@ -63,8 +61,7 @@ void COSOperator::copyToClipboard(const c8 *text) const
return;
// Windows version
#if defined(_IRR_XBOX_PLATFORM_)
#elif defined(_IRR_WINDOWS_API_)
#if defined(_IRR_WINDOWS_API_)
if (!OpenClipboard(NULL) || text == 0)
return;
@ -101,8 +98,6 @@ void COSOperator::copyToClipboard(const c8 *text) const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
IrrDeviceLinux->copyToClipboard(text);
#else
#endif
}
@ -111,9 +106,7 @@ void COSOperator::copyToClipboard(const c8 *text) const
//! \return Returns 0 if no string is in there, otherwise an utf-8 string.
const c8* COSOperator::getTextFromClipboard() const
{
#if defined(_IRR_XBOX_PLATFORM_)
return 0;
#elif defined(_IRR_WINDOWS_API_)
#if defined(_IRR_WINDOWS_API_)
if (!OpenClipboard(NULL))
return 0;
@ -156,7 +149,7 @@ const c8* COSOperator::getTextFromClipboard() const
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
{
#if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_)
#if defined(_IRR_WINDOWS_API_)
MEMORYSTATUSEX MemoryStatusEx;
MemoryStatusEx.dwLength = sizeof(MEMORYSTATUSEX);

View File

@ -20,11 +20,6 @@
#include <GL/glext.h>
#endif
#include <GL/wglext.h>
#ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib")
#endif
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1

View File

@ -11,10 +11,6 @@
#include <GL/gl.h>
#include <GL/wglext.h>
#ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib")
#endif
namespace irr
{
namespace video

View File

@ -8,7 +8,7 @@ static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Geb
#ifdef _IRR_WINDOWS_
#include <windows.h>
#if defined(_DEBUG) && !defined(__GNUWIN32__) && !defined(_WIN32_WCE)
#if defined(_DEBUG) && !defined(__GNUWIN32__)
#include <crtdbg.h>
#endif // _DEBUG
#endif
@ -148,7 +148,7 @@ BOOL APIENTRY DllMain( HANDLE hModule,
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
#if defined(_DEBUG) && !defined(__GNUWIN32__) && !defined(__BORLANDC__) && !defined (_WIN32_WCE) && !defined (_IRR_XBOX_PLATFORM_)
#if defined(_DEBUG) && !defined(__GNUWIN32__)
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
#endif
break;

View File

@ -1,30 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __S_VIDEO_2_SOFTWARE_COMPILE_CONFIG_H_INCLUDED__
#define __S_VIDEO_2_SOFTWARE_COMPILE_CONFIG_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifndef REALINLINE
#ifdef _MSC_VER
#define REALINLINE __forceinline
#else
#define REALINLINE inline
#endif
#endif
//! Size of a static C-style array.
#define array_size(_arr) ((sizeof(_arr)/sizeof(*_arr)))
//! Compiler Align
#if defined(_MSC_VER)
#define ALIGN(x) __declspec(align(x))
#elif defined(__GNUC__)
#define ALIGN(x) __attribute__ ((aligned(x)))
#else
#define ALIGN(x)
#endif
#endif // __S_VIDEO_2_SOFTWARE_COMPILE_CONFIG_H_INCLUDED__

View File

@ -10,10 +10,17 @@
#ifndef __S_VIDEO_2_SOFTWARE_HELPER_H_INCLUDED__
#define __S_VIDEO_2_SOFTWARE_HELPER_H_INCLUDED__
#include "SoftwareDriver2_compile_config.h"
#include "irrMath.h"
#include "SMaterial.h"
#ifndef REALINLINE
#ifdef _MSC_VER
#define REALINLINE __forceinline
#else
#define REALINLINE inline
#endif
#endif
namespace irr
{

View File

@ -12,14 +12,12 @@
#define bswap_16(X) SDL_Swap16(X)
#define bswap_32(X) SDL_Swap32(X)
#define bswap_64(X) SDL_Swap64(X)
#elif defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1298)
#elif defined(_IRR_WINDOWS_API_) && defined(_MSC_VER)
#include <stdlib.h>
#define bswap_16(X) _byteswap_ushort(X)
#define bswap_32(X) _byteswap_ulong(X)
#define bswap_64(X) _byteswap_uint64(X)
#if (_MSC_VER >= 1400)
#define localtime _localtime_s
#endif
#elif defined(_IRR_OSX_PLATFORM_) || defined(_IRR_IOS_PLATFORM_)
#include <libkern/OSByteOrder.h>
#define bswap_16(X) OSReadSwapInt16(&X,0)
@ -65,13 +63,9 @@ namespace os
// Windows specific functions
// ----------------------------------------------------------------
#ifdef _IRR_XBOX_PLATFORM_
#include <xtl.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <time.h>
#endif
namespace irr
{
@ -80,16 +74,10 @@ namespace os
//! prints a debuginfo string
void Printer::print(const c8* message, ELOG_LEVEL ll)
{
#if defined (_WIN32_WCE )
core::stringw tmp(message);
tmp += L"\n";
OutputDebugStringW(tmp.c_str());
#else
core::stringc tmp(message);
tmp += "\n";
OutputDebugStringA(tmp.c_str());
printf("%s", tmp.c_str());
#endif
}
static LARGE_INTEGER HighPerformanceFreq;