Fixes for clang
authorhgn <hgodden00@gmail.com>
Wed, 26 Oct 2022 02:49:44 +0000 (03:49 +0100)
committerhgn <hgodden00@gmail.com>
Wed, 26 Oct 2022 02:49:44 +0000 (03:49 +0100)
src/vg/vg_audio.h
src/vg/vg_mem.h
src/vg/vg_steam_networking.h

index cb6f41c3e99f5d4094d6de3b32e133dbbad71ba2..5b8def23ae2634f1939caa4023ea70b618853df2 100644 (file)
 #include <time.h>
 
 #ifdef __GNUC__
+#ifndef __clang__
   #pragma GCC push_options
   #pragma GCC optimize ("O3")
 #endif
+#endif
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #pragma GCC diagnostic pop 
 
 #ifdef __GNUC__
+#ifndef __clang__
   #pragma GCC pop_options
 #endif
+#endif
 
 #define SFX_MAX_SYSTEMS       32
 #define AUDIO_FLAG_LOOP       0x1
index a3c7cd6e8d92b343b2627e0d1a29efb343e1d296..4f293c2190b99f9f433bf8feb977a339fade0538 100644 (file)
@@ -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
    {
index 679fe89e8d63c6bd0f297b5cca9d710b9549ece2..6eb059909d261274abe9321572f935140b0fed68 100644 (file)
@@ -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
 {
        /*