OpenRCT2/src/common.h

51 lines
1.5 KiB
C
Raw Normal View History

#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
2014-10-06 18:36:58 +02:00
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
2014-10-06 18:36:58 +02:00
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
2014-10-06 18:36:58 +02:00
*****************************************************************************/
#pragma endregion
2014-10-06 18:36:58 +02:00
#ifndef _COMMON_H_
#define _COMMON_H_
#include "diagnostic.h"
2014-10-06 18:36:58 +02:00
#include "rct2.h"
#define SafeFree(x) do { free(x); (x) = NULL; } while (0)
#define SafeDelete(x) do { delete (x); (x) = nullptr; } while (0)
#define SafeDeleteArray(x) do { delete[] (x); (x) = nullptr; } while (0)
2015-09-12 19:17:25 +02:00
#ifndef interface
#define interface struct
#endif
#define abstract = 0
#if defined(__i386__) || defined(_M_IX86)
2016-04-21 22:18:59 +02:00
#define PLATFORM_X86
#endif
#ifdef PLATFORM_X86
2016-02-20 11:12:00 +01:00
#ifdef __GNUC__
#define FASTCALL __attribute__((fastcall))
#elif _MSC_VER
#define FASTCALL __fastcall
#else
#pragma message "Not using fastcall calling convention, please check your compiler support"
#define FASTCALL
#endif
2016-04-21 22:18:59 +02:00
#else // PLATFORM_X86
#define FASTCALL
#endif // PLATFORM_X86
2016-02-20 11:12:00 +01:00
#endif