commit 2ae16e37ef9143ab34f1a87080dab2c79e1e709a parent c256d6161e6ea80037b3bed42f6bc7731a0cc8c8 Author: Michael Savage <mikejsavage@gmail.com> Date: Thu Dec 29 14:37:18 +0200 More #pragma once Diffstat:
platform.h | | | 5 | +---- |
platform_audio_output.h | | | 5 | +---- |
platform_inline.h | | | 5 | +---- |
platform_io.h | | | 5 | +---- |
platform_library.h | | | 7 | ++----- |
platform_mutex.h | | | 5 | +---- |
platform_semaphore.h | | | 5 | +---- |
platform_thread.h | | | 5 | +---- |
queue.h | | | 5 | +---- |
renderer.h | | | 5 | +---- |
rng/fixed.h | | | 5 | +---- |
rng/rng_utils.h | | | 5 | +---- |
rng/well512.h | | | 5 | +---- |
skybox.h | | | 5 | +---- |
stats.h | | | 5 | +---- |
str.h | | | 5 | +---- |
strlcpy.h | | | 5 | +---- |
terrain_manager.h | | | 5 | +---- |
unix_library.h | | | 5 | +---- |
unix_mutex.h | | | 5 | +---- |
unix_thread.h | | | 5 | +---- |
wave.h | | | 5 | +---- |
win32_library.h | | | 5 | +---- |
win32_semaphore.h | | | 5 | +---- |
win32_thread.h | | | 5 | +---- |
work_queue.h | | | 5 | +---- |
diff --git a/platform.h b/platform.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ +#pragma once #if defined( _WIN32 ) # define PLATFORM_WINDOWS 1 @@ -31,5 +30,3 @@ #ifdef RL_TEST # define PLATFORM_RELACY 1 #endif - -#endif // _PLATFORM_H_ diff --git a/platform_audio_output.h b/platform_audio_output.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_AUDIO_H_ -#define _PLATFORM_AUDIO_H_ +#pragma once #include "intrinsics.h" #include "platform.h" @@ -22,5 +21,3 @@ void audio_output_close( AudioOutputDevice * device ); #else #error new platform #endif - -#endif // _PLATFORM_AUDIO_H_ diff --git a/platform_inline.h b/platform_inline.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_INLINE_H_ -#define _PLATFORM_INLINE_H_ +#pragma once #include "platform.h" @@ -12,5 +11,3 @@ #endif #define forceinline inline FORCE_INLINE - -#endif // _PLATFORM_INLINE_H_ diff --git a/platform_io.h b/platform_io.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_IO_H_ -#define _PLATFORM_IO_H_ +#pragma once #include "platform.h" @@ -18,5 +17,3 @@ #else #error new platform #endif - -#endif // _PLATFORM_IO_H_ diff --git a/platform_library.h b/platform_library.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_LIBRARY_H_ -#define _PLATFORM_LIBRARY_H_ +#pragma once #include "platform.h" @@ -8,7 +7,5 @@ #elif PLATFORM_UNIX #include "unix_library.h" #else -#error new library +#error new platform #endif - -#endif // _PLATFORM_LIBRARY_H_ diff --git a/platform_mutex.h b/platform_mutex.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_MUTEX_H_ -#define _PLATFORM_MUTEX_H_ +#pragma once #include "platform.h" @@ -26,5 +25,3 @@ struct ScopedMutexLock { #define SCOPED_MUTEX_LOCK( mutex ) \ ScopedMutexLock CONCAT( scoped_mtx, __COUNTER___ )( mutex ); - -#endif // _PLATFORM_MUTEX_H_ diff --git a/platform_semaphore.h b/platform_semaphore.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_SEMAPHORE_H_ -#define _PLATFORM_SEMAPHORE_H_ +#pragma once #include "platform.h" @@ -12,5 +11,3 @@ #else #error new platform #endif - -#endif // _PLATFORM_SEMAPHORE_H_ diff --git a/platform_thread.h b/platform_thread.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_THREAD_H_ -#define _PLATFORM_THREAD_H_ +#pragma once #include "platform.h" @@ -13,5 +12,3 @@ #else #error new platform #endif - -#endif // _PLATFORM_THREAD_H_ diff --git a/queue.h b/queue.h @@ -1,5 +1,4 @@ -#ifndef _QUEUE_H_ -#define _QUEUE_H_ +#pragma once #include "platform_thread.h" @@ -75,5 +74,3 @@ public: private: NonblockingQueue< T > * q; }; - -#endif // _QUEUE_H_ diff --git a/renderer.h b/renderer.h @@ -1,5 +1,4 @@ -#ifndef _RENDERER_H_ -#define _RENDERER_H_ +#pragma once #include "intrinsics.h" @@ -175,5 +174,3 @@ void renderer_delete_texture( Texture texture ); Mesh renderer_new_mesh( MeshConfig config ); void renderer_draw_mesh( const Mesh & mesh, RenderState state ); void renderer_delete_mesh( const Mesh & mesh ); - -#endif // _RENDERER_H_ diff --git a/rng/fixed.h b/rng/fixed.h @@ -1,5 +1,4 @@ -#ifndef _RNG_FIXED_H_ -#define _RNG_FIXED_H_ +#pragma once #include "../intrinsics.h" #include "rng_utils.h" @@ -12,5 +11,3 @@ void rng_fixed_init( RNGFixed * rng ); u32 rng_fixed_next( RNGFixed * rng ); u32 rng_next( RNGFixed * rng ); - -#endif // _RNG_FIXED_H_ diff --git a/rng/rng_utils.h b/rng/rng_utils.h @@ -1,5 +1,4 @@ -#ifndef _RNG_UTILS_H_ -#define _RNG_UTILS_H_ +#pragma once #include "../intrinsics.h" @@ -73,5 +72,3 @@ template< typename T > u64 rng_next_u64( T * rng ) { return ( u64( rng_next( rng ) ) << u64( 31 ) ) | rng_next( rng ); } - -#endif // _RNG_UTILS_H_ diff --git a/rng/well512.h b/rng/well512.h @@ -1,5 +1,4 @@ -#ifndef _WELL512_H_ -#define _WELL512_H_ +#pragma once #include "../intrinsics.h" #include "rng_utils.h" @@ -13,5 +12,3 @@ void rng_well512_init( RNGWell512 * rng ); u32 rng_well512_next( RNGWell512 * rng ); u32 rng_next( RNGWell512 * rng ); - -#endif // _WELL512_H_ diff --git a/skybox.h b/skybox.h @@ -1,5 +1,4 @@ -#ifndef _SKYBOX_H_ -#define _SKYBOX_H_ +#pragma once #include "linear_algebra.h" #include "renderer.h" @@ -14,5 +13,3 @@ struct Skybox { void skybox_init( Skybox * skybox ); void skybox_render( const Skybox * skybox, v3 angles, float sun ); void skybox_destroy( Skybox * skybox ); - -#endif // _SKYBOX_H_ diff --git a/stats.h b/stats.h @@ -1,5 +1,4 @@ -#ifndef _STATS_H_ -#define _STATS_H_ +#pragma once #include "intrinsics.h" #include "rng/well512.h" @@ -23,5 +22,3 @@ double stats_mean( const Stats * stats ); double stats_stddev( const Stats * stats ); void stats_record( Stats * stats, double x ); void stats_print( Stats * stats ); - -#endif // _STATS_H_ diff --git a/str.h b/str.h @@ -1,5 +1,4 @@ -#ifndef _STR_H_ -#define _STR_H_ +#pragma once #include <stdio.h> #include <stdlib.h> @@ -99,5 +98,3 @@ private: char buf[ N ]; size_t length; }; - -#endif // _STR_H_ diff --git a/strlcpy.h b/strlcpy.h @@ -1,6 +1,3 @@ -#ifndef _STRLCPY_H_ -#define _STRLCPY_H_ +#pragma once size_t strlcpy( char * dst, const char * src, size_t dsize ); - -#endif // _STRLCPY_H_ diff --git a/terrain_manager.h b/terrain_manager.h @@ -1,5 +1,4 @@ -#ifndef _TERRAIN_MANAGER_H_ -#define _TERRAIN_MANAGER_H_ +#pragma once #include "intrinsics.h" #include "array.h" @@ -90,5 +89,3 @@ float terrain_height( const TerrainManager * tm, v3 position ); v3 terrain_normal( const TerrainManager * tm, v3 position ); bool segment_vs_terrain( const TerrainManager * tm, v3 seg_origin, v3 seg_end, float * t, v3 * xnormal ); - -#endif // _TERRAIN_MANAGER_H_ diff --git a/unix_library.h b/unix_library.h @@ -1,5 +1,4 @@ -#ifndef _UNIX_LIBRARY_H_ -#define _UNIX_LIBRARY_H_ +#pragma once #include <dlfcn.h> @@ -22,5 +21,3 @@ void library_close( Library lib ) { errx( 1, "dlclose: %s", dlerror() ); } } - -#endif // _UNIX_LIBRARY_H_ diff --git a/unix_mutex.h b/unix_mutex.h @@ -1,5 +1,4 @@ -#ifndef _UNIX_MUTEX_H_ -#define _UNIX_MUTEX_H_ +#pragma once #include <err.h> #include <pthread.h> @@ -43,5 +42,3 @@ inline void mutex_unlock( Mutex * mutex ) { err( 1, "pthread_mutex_unlock: %d", ok ); } } - -#endif // _UNIX_MUTEX_H_ diff --git a/unix_thread.h b/unix_thread.h @@ -1,5 +1,4 @@ -#ifndef _UNIX_THREAD_H_ -#define _UNIX_THREAD_H_ +#pragma once #include <err.h> #include <pthread.h> @@ -66,5 +65,3 @@ inline void thread_yield() { #error new platform #endif } - -#endif // _UNIX_THREAD_H_ diff --git a/wave.h b/wave.h @@ -1,10 +1,7 @@ -#ifndef _WAVE_H_ -#define _WAVE_H_ +#pragma once #include "intrinsics.h" #include "memory_arena.h" #include "assets.h" bool wave_decode( MemoryArena * arena, u8 * data, size_t len, SoundData * sound ); - -#endif // _WAVE_H_ diff --git a/win32_library.h b/win32_library.h @@ -1,5 +1,4 @@ -#ifndef _WIN32_LIBRARY_H_ -#define _WIN32_LIBRARY_H_ +#pragma once #include <windows.h> @@ -35,5 +34,3 @@ void library_close( Library lib ) { // TODO: check for errors FreeLibrary( lib ); } - -#endif // _WIN32_LIBRARY_H_ diff --git a/win32_semaphore.h b/win32_semaphore.h @@ -1,5 +1,4 @@ -#ifndef _WIN32_SEMAPHORE_H_ -#define _WIN32_SEMAPHORE_H_ +#pragma once #include <windows.h> @@ -33,5 +32,3 @@ inline void semaphore_wait( Semaphore * sem ) { FATAL( "WaitForSingleObject failed" ); } } - -#endif // _WIN32_SEMAPHORE_H_ diff --git a/win32_thread.h b/win32_thread.h @@ -1,5 +1,4 @@ -#ifndef _WINDOWS_THREAD_H_ -#define _WINDOWS_THREAD_H_ +#pragma once #include <windows.h> @@ -32,5 +31,3 @@ inline u32 thread_getid() { inline void thread_yield() { SwitchToThread(); } - -#endif // _WINDOWS_THREAD_H_ diff --git a/work_queue.h b/work_queue.h @@ -1,5 +1,4 @@ -#ifndef _WORK_QUEUE_H_ -#define _WORK_QUEUE_H_ +#pragma once #include "intrinsics.h" #include "platform_atomic.h" @@ -28,5 +27,3 @@ struct WorkQueue { void workqueue_init( WorkQueue * queue, MemoryArena * arena, u32 num_threads ); void workqueue_enqueue( WorkQueue * queue, WorkQueueCallback * callback, const void * data ); void workqueue_exhaust( WorkQueue * queue ); - -#endif // _WORK_QUEUE_H_