MSVC does not have __attribute__((weak))

This commit is contained in:
apio 2022-12-25 13:00:47 +01:00
parent a04af496f0
commit 51b09f35ad
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -6,9 +6,15 @@
#include <stdnoreturn.h>
#include <string.h>
#ifndef _MSC_VER
#define WEAK __attribute__((weak))
#else
#define WEAK
#endif
// Default implementation for minitar_handle_panic(). Since it's declared weak, any other definition will silently
// override this one :)
__attribute__((weak)) noreturn void minitar_handle_panic(const char* message)
WEAK noreturn void minitar_handle_panic(const char* message)
{
fprintf(stderr, "minitar: %s\n", message);
abort();