X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_io.h;h=87562ace408a919ba0d02afdc4c0262ac3e64893;hb=76d234b7dc5e6500e8a54009b367e7620f11ef97;hp=06aee757179ca82c525c8c9c3f49368603351a5e;hpb=13737a7a9faa5b31696c711f153b7de4201c404e;p=vg.git diff --git a/vg_io.h b/vg_io.h index 06aee75..87562ac 100644 --- a/vg_io.h +++ b/vg_io.h @@ -135,7 +135,16 @@ static void vg_dir_close( vg_dir *dir ){ #define VG_FILE_IO_CHUNK_SIZE 1024*256 -VG_STATIC void vg_file_print_invalid( FILE *fp ) +#ifdef __GNUC__ + #ifndef __clang__ + #pragma GCC push_options + #pragma GCC optimize ("O3") + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif +#endif + +static void vg_file_print_invalid( FILE *fp ) { if( feof( fp )) { vg_error( "mdl_open: header too short\n" ); @@ -150,7 +159,7 @@ VG_STATIC void vg_file_print_invalid( FILE *fp ) } /* read entire binary file */ -VG_STATIC void *vg_file_read( void *lin_alloc, const char *path, u32 *size ) +static void *vg_file_read( void *lin_alloc, const char *path, u32 *size ) { FILE *f = fopen( path, "rb" ); if( f ){ @@ -194,7 +203,7 @@ VG_STATIC void *vg_file_read( void *lin_alloc, const char *path, u32 *size ) } /* read entire file and append a null on the end */ -VG_STATIC char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz ) +static char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz ) { u32 size; char *str = vg_file_read( lin_alloc, path, &size ); @@ -211,7 +220,7 @@ VG_STATIC char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz ) } -VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){ +static int vg_asset_write( const char *path, void *data, i64 size ){ FILE *f = fopen( path, "wb" ); if( f ){ fwrite( data, size, 1, f ); @@ -224,7 +233,7 @@ VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){ } /* TODO: error handling if read fails */ -VG_STATIC int vg_file_copy( const char *src, const char *dst, void *lin_alloc ) +static int vg_file_copy( const char *src, const char *dst, void *lin_alloc ) { vg_info( "vg_file_copy( %s -> %s )\n", src, dst ); u32 size; @@ -232,7 +241,7 @@ VG_STATIC int vg_file_copy( const char *src, const char *dst, void *lin_alloc ) return vg_asset_write( dst, data, size ); } -VG_STATIC const char *vg_path_filename( const char *path ) +static const char *vg_path_filename( const char *path ) { const char *base = path; @@ -246,4 +255,11 @@ VG_STATIC const char *vg_path_filename( const char *path ) return base; } +#ifdef __GNUC__ + #ifndef __clang__ + #pragma GCC pop_options + #pragma GCC diagnostic pop + #endif +#endif + #endif /* VG_IO_H */