Attempt At Fixing Clang (#647)

* Update Game.h

* Update Game.h

* Update macros.h
This commit is contained in:
MegaMech
2026-02-08 13:50:22 -07:00
committed by GitHub
parent f3d6612b20
commit 3aa2c9662a
2 changed files with 16 additions and 11 deletions
+14
View File
@@ -4,6 +4,20 @@
#include <math.h>
#include <libultraship.h>
// no return attribute
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdnoreturn.h>
#define NORETURN noreturn
#elif defined(__cplusplus) && __cplusplus >= 201103L
#define NORETURN [[noreturn]]
#elif defined(_MSC_VER)
#define NORETURN __declspec(noreturn)
#elif defined(__GNUC__) || defined(__clang__)
#define NORETURN __attribute__((noreturn))
#else
#define NORETURN
#endif
#ifndef __sgi
#define GLOBAL_ASM(...)
#endif
+2 -11
View File
@@ -4,6 +4,7 @@
#include <libultraship.h>
#include "engine/tracks/Track.h"
#include "engine/HM_Intro.h"
#include "macros.h"
#ifdef __cplusplus
#include "engine/editor/Editor.h"
@@ -235,17 +236,7 @@ void CM_ResetAudio(void);
__attribute__((format(printf, 1, 2)))
#endif
// Add noreturn attribute
#if defined(_MSC_VER)
__declspec(noreturn)
#elif defined(__APPLE__)
#elif defined(__OpenBSD__)
#elif defined(__cplusplus) || (__STDC_VERSION__ >= 202311)
[[noreturn]]
#elif defined(__GNUC__)
__attribute__((noreturn))
#endif
void CM_ThrowRuntimeError(const char* fmt, ...);
NORETURN void CM_ThrowRuntimeError(const char* fmt, ...);
// NOLINTEND(readability-identifier-naming)