From: hgn Date: Wed, 26 Oct 2022 02:49:44 +0000 (+0100) Subject: Fixes for clang X-Git-Url: https://harrygodden.com/git/?p=vg.git;a=commitdiff_plain;h=c6867ba25b100d7e633ab67e1c5ecb0be44efc24 Fixes for clang --- diff --git a/src/vg/vg_audio.h b/src/vg/vg_audio.h index cb6f41c..5b8def2 100644 --- a/src/vg/vg_audio.h +++ b/src/vg/vg_audio.h @@ -28,9 +28,11 @@ #include #ifdef __GNUC__ +#ifndef __clang__ #pragma GCC push_options #pragma GCC optimize ("O3") #endif +#endif #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -41,8 +43,10 @@ #pragma GCC diagnostic pop #ifdef __GNUC__ +#ifndef __clang__ #pragma GCC pop_options #endif +#endif #define SFX_MAX_SYSTEMS 32 #define AUDIO_FLAG_LOOP 0x1 diff --git a/src/vg/vg_mem.h b/src/vg/vg_mem.h index a3c7cd6..4f293c2 100644 --- a/src/vg/vg_mem.h +++ b/src/vg/vg_mem.h @@ -148,19 +148,10 @@ VG_STATIC void *vg_create_linear_allocator( void *lin_alloc, u32 size ) if( lin_alloc == NULL ) { - static int allow_once = 1; + allocptr = malloc( total ); - if( allow_once ) - { - allocptr = malloc( total ); - - if( allocptr == NULL ) - vg_fatal_exit_loop( "Create linear: Malloc failed" ); - - allow_once = 0; - } - else - vg_fatal_exit_loop( "Shouldnt call this twice!" ); + if( allocptr == NULL ) + vg_fatal_exit_loop( "Create linear: Malloc failed" ); } else { diff --git a/src/vg/vg_steam_networking.h b/src/vg/vg_steam_networking.h index 679fe89..6eb0599 100644 --- a/src/vg/vg_steam_networking.h +++ b/src/vg/vg_steam_networking.h @@ -4,6 +4,7 @@ #include "vg_steam.h" #ifdef VALVE_CALLBACK_PACK_SMALL +; #pragma pack(push,4) #else #pragma pack(push,8) @@ -615,7 +616,6 @@ enum{ k_nSteamNetworkConnectionInfoFlags_Relayed = 16 }; enum{ k_nSteamNetworkConnectionInfoFlags_DualWifi = 32 }; /* Describe the state of a connection. */ -typedef struct SteamNetConnectionInfo_t SteamNetConnectionInfo_t; struct SteamNetConnectionInfo_t { /*