From 7a1119bac02dcbc915791fb60b91173701871f14 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 28 May 2022 07:26:08 +0300 Subject: [PATCH] Use C++ noreturn attribute --- src/interpreter.cc | 2 +- src/interpreter.h | 2 +- src/memory_manager.cc | 2 +- src/memory_manager.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interpreter.cc b/src/interpreter.cc index 826b606..0bc49b7 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -127,7 +127,7 @@ char* programGetCurrentProcedureName(Program* program) } // 0x4671F0 -__declspec(noreturn) void programFatalError(const char* format, ...) +[[noreturn]] void programFatalError(const char* format, ...) { char string[260]; diff --git a/src/interpreter.h b/src/interpreter.h index beee1bf..ff0d9f8 100644 --- a/src/interpreter.h +++ b/src/interpreter.h @@ -189,7 +189,7 @@ int _checkWait(Program* program); void _interpretOutputFunc(int (*func)(char*)); int _interpretOutput(const char* format, ...); char* programGetCurrentProcedureName(Program* s); -__declspec(noreturn) void programFatalError(const char* str, ...); +[[noreturn]] void programFatalError(const char* str, ...); opcode_t stackReadInt16(unsigned char* data, int pos); int stackReadInt32(unsigned char* a1, int a2); void stackWriteInt16(int value, unsigned char* a2, int a3); diff --git a/src/memory_manager.cc b/src/memory_manager.cc index 1abf8df..2c7b5a0 100644 --- a/src/memory_manager.cc +++ b/src/memory_manager.cc @@ -44,7 +44,7 @@ int memoryManagerPrintError(const char* format, ...) } // 0x484610 -__declspec(noreturn) void memoryManagerFatalAllocationError(const char* func, size_t size, const char* file, int line) +[[noreturn]] void memoryManagerFatalAllocationError(const char* func, size_t size, const char* file, int line) { memoryManagerPrintError("%s: Error allocating block of size %ld (%x), %s %d\n", func, size, size, file, line); exit(1); diff --git a/src/memory_manager.h b/src/memory_manager.h index 10e3c5b..6dd24dd 100644 --- a/src/memory_manager.h +++ b/src/memory_manager.h @@ -15,7 +15,7 @@ extern char gMemoryManagerLastError[256]; void memoryManagerDefaultPrintErrorImpl(const char* string); int memoryManagerPrintError(const char* format, ...); -__declspec(noreturn) void memoryManagerFatalAllocationError(const char* func, size_t size, const char* file, int line); +[[noreturn]] void memoryManagerFatalAllocationError(const char* func, size_t size, const char* file, int line); void* memoryManagerDefaultMallocImpl(size_t size); void* memoryManagerDefaultReallocImpl(void* ptr, size_t size); void memoryManagerDefaultFreeImpl(void* ptr);