From 4decd24bcdc9642d7895defcd59059f9aaaf94d7 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Sat, 28 Nov 2020 22:38:57 -0500 Subject: [PATCH] Build fix for __THROWNL not being defined on libc that is used by Alpine Linux --- src/drivers/Qt/LuaControl.h | 15 +++++++++++---- src/lua-engine.cpp | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/drivers/Qt/LuaControl.h b/src/drivers/Qt/LuaControl.h index 811346a6..582e60c1 100644 --- a/src/drivers/Qt/LuaControl.h +++ b/src/drivers/Qt/LuaControl.h @@ -3,6 +3,8 @@ #pragma once +#include + #include #include #include @@ -53,12 +55,17 @@ class LuaControlDialog_t : public QDialog // Formatted print #ifdef WIN32 - int LuaPrintfToWindowConsole(_In_z_ _Printf_format_string_ const char* const format, ...) ; + int LuaPrintfToWindowConsole(_In_z_ _Printf_format_string_ const char* const format, ...) ; #elif __linux__ - int LuaPrintfToWindowConsole(const char *__restrict format, ...) - __THROWNL __attribute__ ((__format__ (__printf__, 1, 2))); + #ifdef __THROWNL + int LuaPrintfToWindowConsole(const char *__restrict format, ...) + __THROWNL __attribute__ ((__format__ (__printf__, 1, 2))); + #else + int LuaPrintfToWindowConsole(const char *__restrict format, ...) + throw() __attribute__ ((__format__ (__printf__, 1, 2))); + #endif #else - int LuaPrintfToWindowConsole(const char *__restrict format, ...) throw(); + int LuaPrintfToWindowConsole(const char *__restrict format, ...) throw(); #endif void PrintToWindowConsole(intptr_t hDlgAsInt, const char* str); diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 2f624c06..68f608d9 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -194,6 +194,10 @@ void TaseditorDisableManualFunctionIfNeeded(); #else int LuaKillMessageBox(void); #ifdef __linux__ + +#ifndef __THROWNL +#define __THROWNL throw () // Build fix Alpine Linux libc +#endif int LuaPrintfToWindowConsole(const char *__restrict format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 1, 2))); #else