From 769367897fd09384d76abb7bfe78ff1faa9f25e6 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 14 Apr 2017 10:01:50 +0200 Subject: [PATCH 1/6] Bump version to v0.4.1 --- CMakeLists.txt | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04f40eb..e6b01f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ include(CMakeDependentOption) set(GMIO_VERSION_MAJOR 0) set(GMIO_VERSION_MINOR 4) -set(GMIO_VERSION_PATCH 0) +set(GMIO_VERSION_PATCH 1) set(GMIO_VERSION ${GMIO_VERSION_MAJOR}.${GMIO_VERSION_MINOR}.${GMIO_VERSION_PATCH}) diff --git a/README.md b/README.md index f730afd..6c112d4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Codecov](https://codecov.io/github/fougue/gmio/coverage.svg?branch=master)](https://codecov.io/gh/fougue/gmio/branch/master) [![License](https://img.shields.io/badge/license-BSD%202--clause-blue.svg)](https://github.com/fougue/gmio/blob/master/LICENSE.txt) -[![Version](https://img.shields.io/badge/version-v0.4.0-blue.svg?style=flat)](https://github.com/fougue/gmio/releases) +[![Version](https://img.shields.io/badge/version-v0.4.1-blue.svg?style=flat)](https://github.com/fougue/gmio/releases) C library for geometry input/output From be1ced46edef333dd17d5d6cd41035d5c7e268c8 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 6 Apr 2017 12:22:02 +0200 Subject: [PATCH 2/6] scripts: fix paths in bump-version.rb --- scripts/bump-version.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/bump-version.rb b/scripts/bump-version.rb index a7c04e7..ad880c4 100644 --- a/scripts/bump-version.rb +++ b/scripts/bump-version.rb @@ -14,7 +14,7 @@ if not ARGV.empty? then script_dir_name = File.expand_path(File.dirname(__FILE__)) # CMakeLists.txt - path_CMakeLists_txt = "#{script_dir_name}/CMakeLists.txt" + path_CMakeLists_txt = "#{script_dir_name}/../CMakeLists.txt" CMakeLists_txt = File.open(path_CMakeLists_txt, "r").read CMakeLists_txt.sub!(/(set\(GMIO_VERSION_MAJOR\s+)\d+/, "\\1#{major}") CMakeLists_txt.sub!(/(set\(GMIO_VERSION_MINOR\s+)\d+/, "\\1#{minor}") @@ -23,7 +23,7 @@ if not ARGV.empty? then puts "Bumped #{path_CMakeLists_txt}" # README.md - path_README_md = "#{script_dir_name}/README.md" + path_README_md = "#{script_dir_name}/../README.md" README_md = File.open(path_README_md, "r").read README_md.sub!( /(img\.shields\.io\/badge\/version\-v)\d+\.\d+\.\d+/, @@ -35,7 +35,7 @@ if not ARGV.empty? then puts "Bumped #{path_README_md}" # appveyor.yml - path_appveyor_yml = "#{script_dir_name}/appveyor.yml" + path_appveyor_yml = "#{script_dir_name}/../appveyor.yml" appveyor_yml = File.open(path_appveyor_yml, "r").read appveyor_yml.sub!( /(version:\s+)\d+\.\d+(_build)/, From ed230f69453816c5872067d0cc24c1627db43255 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 6 Apr 2017 15:03:32 +0200 Subject: [PATCH 3/6] core: make version.h appear in generated doc --- doc/Doxyfile.cmake | 6 ++++-- src/gmio_core/version.h.cmake | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile.cmake b/doc/Doxyfile.cmake index 654f364..5151f8c 100644 --- a/doc/Doxyfile.cmake +++ b/doc/Doxyfile.cmake @@ -128,7 +128,8 @@ FULL_PATH_NAMES = YES # If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../src +STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../src \ + @CMAKE_CURRENT_BINARY_DIR@/../src # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells @@ -642,7 +643,8 @@ WARN_LOGFILE = # with spaces. INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../doc/mainpage.dox \ - @CMAKE_CURRENT_SOURCE_DIR@/../src + @CMAKE_CURRENT_SOURCE_DIR@/../src \ + @CMAKE_CURRENT_BINARY_DIR@/../src/gmio_core/version.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/src/gmio_core/version.h.cmake b/src/gmio_core/version.h.cmake index 3188bb3..8a33687 100644 --- a/src/gmio_core/version.h.cmake +++ b/src/gmio_core/version.h.cmake @@ -29,11 +29,29 @@ /* Generated by CMake */ +/*! \file version.h + * Declaration of macros specifying gmio's version + * + * \addtogroup gmio_core + * @{ + */ + #pragma once +/*! Expands to gmio's major version number */ #define GMIO_VERSION_MAJOR @GMIO_VERSION_MAJOR@ + +/*! Expands to gmio's minor version number */ #define GMIO_VERSION_MINOR @GMIO_VERSION_MINOR@ + +/*! Expands to gmio's patch version number */ #define GMIO_VERSION_PATCH @GMIO_VERSION_PATCH@ + +/*! Expands to a string that specifies gmio's version number */ #define GMIO_VERSION_STR "@GMIO_VERSION@" + +/*! Expands to an hexadecimal value of the form \c 0xMMNNPP (MM=major, NN=minor, + * PP=patch) that specifies gmio's version number */ #define GMIO_VERSION 0x0@GMIO_VERSION_MAJOR@0@GMIO_VERSION_MINOR@0@GMIO_VERSION_PATCH@ +/*! @} */ From 94dd70b86c0d8a3743c20d62ab5abb326efe06d6 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 13 Apr 2017 17:33:57 +0200 Subject: [PATCH 4/6] cmake: use check_symbol_exists() to find C99 functions This is a necessary fix for Visual C++ 2015 GitHub issue #9 --- CMakeLists.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b01f7..960e6a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,17 +251,25 @@ endif() if(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE) list(APPEND CMAKE_REQUIRED_LIBRARIES m) # -lm endif() -check_function_exists(powf GMIO_HAVE_POWF_FUNC) -check_function_exists(sqrtf GMIO_HAVE_SQRTF_FUNC) -check_function_exists(strtof GMIO_HAVE_STRTOF_FUNC) +check_symbol_exists(powf math.h GMIO_HAVE_POWF_FUNC) +check_symbol_exists(sqrtf math.h GMIO_HAVE_SQRTF_FUNC) +check_symbol_exists(strtof stdlib.h GMIO_HAVE_STRTOF_FUNC) check_symbol_exists(isfinite math.h GMIO_HAVE_ISFINITE_SYM) -check_symbol_exists(isnan math.h GMIO_HAVE_ISNAN_SYM) +check_symbol_exists(isnan math.h GMIO_HAVE_ISNAN_SYM) +check_symbol_exists(snprintf "stdio.h;stdlib.h" GMIO_HAVE_SNPRINTF_FUNC) +check_symbol_exists(vsnprintf stdio.h GMIO_HAVE_VSNPRINTF_FUNC) if(WIN32 AND NOT GMIO_HAVE_ISNAN_SYM) check_symbol_exists(_finite float.h GMIO_HAVE_WIN__FINITE_SYM) endif() if(WIN32 AND NOT GMIO_HAVE_ISNAN_SYM) check_symbol_exists(_isnan float.h GMIO_HAVE_WIN__ISNAN_SYM) endif() +if(WIN32 AND NOT GMIO_HAVE_SNPRINTF_FUNC) + check_symbol_exists(_snprintf stdio.h GMIO_HAVE_WIN__SNPRINTF_FUNC) +endif() +if(WIN32 AND NOT GMIO_HAVE_VSNPRINTF_FUNC) + check_symbol_exists(_vsnprintf stdio.h GMIO_HAVE_WIN__VSNPRINTF_FUNC) +endif() set(CMAKE_REQUIRED_LIBRARIES) # Pop changes @@ -270,16 +278,6 @@ check_c_source_compiles( int main() { const bool c = 0; return 0; }" GMIO_HAVE_C99_BOOL) -check_function_exists(snprintf GMIO_HAVE_SNPRINTF_FUNC) -if(WIN32 AND NOT GMIO_HAVE_SNPRINTF_FUNC) - check_function_exists(_snprintf GMIO_HAVE_WIN__SNPRINTF_FUNC) -endif() - -check_function_exists(vsnprintf GMIO_HAVE_VSNPRINTF_FUNC) -if(WIN32 AND NOT GMIO_HAVE_VSNPRINTF_FUNC) - check_function_exists(_vsnprintf GMIO_HAVE_WIN__VSNPRINTF_FUNC) -endif() - # Check available POSIX features if(UNIX) # See: From 8e4c556ba6c9c33b4259010a6a490ec0968a79ac Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 13 Apr 2017 17:53:32 +0200 Subject: [PATCH 5/6] cmake: remove _FUNC and _SYM variable suffix --- CMakeLists.txt | 46 +++++++++++----------- src/gmio_core/config.h.cmake | 32 +++++++-------- src/gmio_core/internal/byte_swap.h | 10 ++--- src/gmio_core/internal/c99_math_compat.h | 12 +++--- src/gmio_core/internal/c99_stdio_compat.h | 8 ++-- src/gmio_core/internal/c99_stdlib_compat.h | 2 +- src/gmio_core/stream.c | 6 +-- 7 files changed, 58 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 960e6a3..0943328 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,24 +251,24 @@ endif() if(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE) list(APPEND CMAKE_REQUIRED_LIBRARIES m) # -lm endif() -check_symbol_exists(powf math.h GMIO_HAVE_POWF_FUNC) -check_symbol_exists(sqrtf math.h GMIO_HAVE_SQRTF_FUNC) -check_symbol_exists(strtof stdlib.h GMIO_HAVE_STRTOF_FUNC) -check_symbol_exists(isfinite math.h GMIO_HAVE_ISFINITE_SYM) -check_symbol_exists(isnan math.h GMIO_HAVE_ISNAN_SYM) -check_symbol_exists(snprintf "stdio.h;stdlib.h" GMIO_HAVE_SNPRINTF_FUNC) -check_symbol_exists(vsnprintf stdio.h GMIO_HAVE_VSNPRINTF_FUNC) -if(WIN32 AND NOT GMIO_HAVE_ISNAN_SYM) - check_symbol_exists(_finite float.h GMIO_HAVE_WIN__FINITE_SYM) +check_symbol_exists(powf math.h GMIO_HAVE_POWF) +check_symbol_exists(sqrtf math.h GMIO_HAVE_SQRTF) +check_symbol_exists(strtof stdlib.h GMIO_HAVE_STRTOF) +check_symbol_exists(isfinite math.h GMIO_HAVE_ISFINITE) +check_symbol_exists(isnan math.h GMIO_HAVE_ISNAN) +check_symbol_exists(snprintf "stdio.h;stdlib.h" GMIO_HAVE_SNPRINTF) +check_symbol_exists(vsnprintf stdio.h GMIO_HAVE_VSNPRINTF) +if(WIN32 AND NOT GMIO_HAVE_ISNAN) + check_symbol_exists(_finite float.h GMIO_HAVE_WIN__FINITE) endif() -if(WIN32 AND NOT GMIO_HAVE_ISNAN_SYM) - check_symbol_exists(_isnan float.h GMIO_HAVE_WIN__ISNAN_SYM) +if(WIN32 AND NOT GMIO_HAVE_ISNAN) + check_symbol_exists(_isnan float.h GMIO_HAVE_WIN__ISNAN) endif() -if(WIN32 AND NOT GMIO_HAVE_SNPRINTF_FUNC) - check_symbol_exists(_snprintf stdio.h GMIO_HAVE_WIN__SNPRINTF_FUNC) +if(WIN32 AND NOT GMIO_HAVE_SNPRINTF) + check_symbol_exists(_snprintf stdio.h GMIO_HAVE_WIN__SNPRINTF) endif() -if(WIN32 AND NOT GMIO_HAVE_VSNPRINTF_FUNC) - check_symbol_exists(_vsnprintf stdio.h GMIO_HAVE_WIN__VSNPRINTF_FUNC) +if(WIN32 AND NOT GMIO_HAVE_VSNPRINTF) + check_symbol_exists(_vsnprintf stdio.h GMIO_HAVE_WIN__VSNPRINTF) endif() set(CMAKE_REQUIRED_LIBRARIES) # Pop changes @@ -304,22 +304,22 @@ if (NOT DEFINED HAVE_SYS_STAT_H) check_include_files(sys/stat.h GMIO_HAVE_SYS_STAT_H) endif() -check_function_exists(fileno GMIO_HAVE_POSIX_FILENO_FUNC) +check_function_exists(fileno GMIO_HAVE_POSIX_FILENO) # Have fstat64() ? check_c_source_compiles( "#include int main() { fstat64(0, NULL); return 0; }" - GMIO_HAVE_POSIX_FSTAT64_FUNC) + GMIO_HAVE_POSIX_FSTAT64) if(WIN32) - check_function_exists(_fstat64 GMIO_HAVE_WIN__FSTAT64_FUNC) + check_function_exists(_fstat64 GMIO_HAVE_WIN__FSTAT64) endif() # Check size(in bytes) of stat::st_size set(CMAKE_EXTRA_INCLUDE_FILES sys/stat.h) -if(GMIO_HAVE_WIN__FSTAT64_FUNC) +if(GMIO_HAVE_WIN__FSTAT64) check_type_size("((struct _stat64*)0)->st_size" GMIO_SIZEOF_STRUCT_STAT_ST_SIZE) -elseif(GMIO_HAVE_POSIX_FSTAT64_FUNC) +elseif(GMIO_HAVE_POSIX_FSTAT64) check_type_size("((struct stat64*)0)->st_size" GMIO_SIZEOF_STRUCT_STAT_ST_SIZE) else() check_type_size("((struct stat*)0)->st_size" GMIO_SIZEOF_STRUCT_STAT_ST_SIZE) @@ -340,15 +340,15 @@ if(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE) # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 check_c_source_compiles( "int main() { return (int)__builtin_bswap16(0x1122); }" - GMIO_HAVE_GCC_BUILTIN_BSWAP16_FUNC) + GMIO_HAVE_GCC_BUILTIN_BSWAP16) check_c_source_compiles( "int main() { return (int)__builtin_bswap32(0x11223344); }" - GMIO_HAVE_GCC_BUILTIN_BSWAP32_FUNC) + GMIO_HAVE_GCC_BUILTIN_BSWAP32) elseif(MSVC) check_c_source_compiles( "#include int main() { return (int)_byteswap_ulong(0x11223344); }" - GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC) + GMIO_HAVE_MSVC_BUILTIN_BSWAP) endif() #set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) diff --git a/src/gmio_core/config.h.cmake b/src/gmio_core/config.h.cmake index f8aa24d..198ecc4 100644 --- a/src/gmio_core/config.h.cmake +++ b/src/gmio_core/config.h.cmake @@ -53,30 +53,30 @@ #cmakedefine GMIO_HAVE_C99_BOOL #endif -#cmakedefine GMIO_HAVE_STRTOF_FUNC -#cmakedefine GMIO_HAVE_POWF_FUNC -#cmakedefine GMIO_HAVE_SNPRINTF_FUNC -#cmakedefine GMIO_HAVE_WIN__SNPRINTF_FUNC -#cmakedefine GMIO_HAVE_VSNPRINTF_FUNC -#cmakedefine GMIO_HAVE_WIN__VSNPRINTF_FUNC +#cmakedefine GMIO_HAVE_STRTOF +#cmakedefine GMIO_HAVE_POWF +#cmakedefine GMIO_HAVE_SNPRINTF +#cmakedefine GMIO_HAVE_WIN__SNPRINTF +#cmakedefine GMIO_HAVE_VSNPRINTF +#cmakedefine GMIO_HAVE_WIN__VSNPRINTF -#cmakedefine GMIO_HAVE_ISFINITE_SYM -#cmakedefine GMIO_HAVE_WIN__FINITE_SYM -#cmakedefine GMIO_HAVE_ISNAN_SYM -#cmakedefine GMIO_HAVE_WIN__ISNAN_SYM +#cmakedefine GMIO_HAVE_ISFINITE +#cmakedefine GMIO_HAVE_WIN__FINITE +#cmakedefine GMIO_HAVE_ISNAN +#cmakedefine GMIO_HAVE_WIN__ISNAN /* POSIX */ #cmakedefine GMIO_HAVE_SYS_TYPES_H #cmakedefine GMIO_HAVE_SYS_STAT_H -#cmakedefine GMIO_HAVE_POSIX_FILENO_FUNC -#cmakedefine GMIO_HAVE_POSIX_FSTAT64_FUNC -#cmakedefine GMIO_HAVE_WIN__FSTAT64_FUNC +#cmakedefine GMIO_HAVE_POSIX_FILENO +#cmakedefine GMIO_HAVE_POSIX_FSTAT64 +#cmakedefine GMIO_HAVE_WIN__FSTAT64 /* Compiler byte-swap functions */ -#cmakedefine GMIO_HAVE_GCC_BUILTIN_BSWAP16_FUNC -#cmakedefine GMIO_HAVE_GCC_BUILTIN_BSWAP32_FUNC +#cmakedefine GMIO_HAVE_GCC_BUILTIN_BSWAP16 +#cmakedefine GMIO_HAVE_GCC_BUILTIN_BSWAP32 -#cmakedefine GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC +#cmakedefine GMIO_HAVE_MSVC_BUILTIN_BSWAP /* Target architecture */ #cmakedefine GMIO_HOST_IS_BIG_ENDIAN diff --git a/src/gmio_core/internal/byte_swap.h b/src/gmio_core/internal/byte_swap.h index bde0c95..1b228fd 100644 --- a/src/gmio_core/internal/byte_swap.h +++ b/src/gmio_core/internal/byte_swap.h @@ -31,7 +31,7 @@ #include "../global.h" -#ifdef GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC +#ifdef GMIO_HAVE_MSVC_BUILTIN_BSWAP # include #endif @@ -39,9 +39,9 @@ * functions if available */ GMIO_INLINE uint16_t gmio_uint16_bswap(uint16_t val) { -#ifdef GMIO_HAVE_GCC_BUILTIN_BSWAP16_FUNC +#ifdef GMIO_HAVE_GCC_BUILTIN_BSWAP16 return __builtin_bswap16(val); -#elif defined(GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC) +#elif defined(GMIO_HAVE_MSVC_BUILTIN_BSWAP) return _byteswap_ushort(val); #else return ((val & 0x00FF) << 8) | ((val >> 8) & 0x00FF); @@ -52,9 +52,9 @@ GMIO_INLINE uint16_t gmio_uint16_bswap(uint16_t val) * functions if available */ GMIO_INLINE uint32_t gmio_uint32_bswap(uint32_t val) { -#ifdef GMIO_HAVE_GCC_BUILTIN_BSWAP32_FUNC +#ifdef GMIO_HAVE_GCC_BUILTIN_BSWAP32 return __builtin_bswap32(val); -#elif defined(GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC) +#elif defined(GMIO_HAVE_MSVC_BUILTIN_BSWAP) return _byteswap_ulong(val); #else return ((val & 0x000000FF) << 24) diff --git a/src/gmio_core/internal/c99_math_compat.h b/src/gmio_core/internal/c99_math_compat.h index dcd8623..eebb164 100644 --- a/src/gmio_core/internal/c99_math_compat.h +++ b/src/gmio_core/internal/c99_math_compat.h @@ -32,7 +32,7 @@ #include "../global.h" #include -#ifdef GMIO_HAVE_POWF_FUNC +#ifdef GMIO_HAVE_POWF # define gmio_powf powf #else /* No powf() function, call pow(double) as fallback */ @@ -40,7 +40,7 @@ GMIO_INLINE float gmio_powf(float base, float exponent) { return (float)pow((double)base, (double)exponent); } #endif -#ifdef GMIO_HAVE_SQRTF_FUNC +#ifdef GMIO_HAVE_SQRTF # define gmio_sqrtf sqrtf #else /* No sqrtf() function, call sqrt(double) as fallback */ @@ -48,9 +48,9 @@ GMIO_INLINE float gmio_sqrtf(float x) { return (float)sqrt((double)x); } #endif -#if defined(GMIO_HAVE_ISFINITE_SYM) +#if defined(GMIO_HAVE_ISFINITE) # define gmio_isfinite(x) isfinite(x) -#elif defined(GMIO_HAVE_WIN__FINITE_SYM) +#elif defined(GMIO_HAVE_WIN__FINITE) # include # define gmio_isfinite(x) _finite(x) #else @@ -58,9 +58,9 @@ GMIO_INLINE float gmio_sqrtf(float x) # define gmio_isfinite(x) (((x) != NAN) && ((x) != INFINITY)) #endif -#if defined(GMIO_HAVE_ISNAN_SYM) +#if defined(GMIO_HAVE_ISNAN) # define gmio_isnan(x) isnan(x) -#elif defined(GMIO_HAVE_WIN__ISNAN_SYM) +#elif defined(GMIO_HAVE_WIN__ISNAN) # include # define gmio_isnan(x) _isnan(x) #else diff --git a/src/gmio_core/internal/c99_stdio_compat.h b/src/gmio_core/internal/c99_stdio_compat.h index ab33602..9821ad6 100644 --- a/src/gmio_core/internal/c99_stdio_compat.h +++ b/src/gmio_core/internal/c99_stdio_compat.h @@ -41,9 +41,9 @@ * * vsnprintf() appeared in C99 */ -#ifdef GMIO_HAVE_VSNPRINTF_FUNC +#ifdef GMIO_HAVE_VSNPRINTF # define gmio_vsnprintf vsnprintf -#elif defined(GMIO_HAVE_WIN__VSNPRINTF_FUNC) +#elif defined(GMIO_HAVE_WIN__VSNPRINTF) # define gmio_vsnprintf _vsnprintf #else /* No vsnprintf()-like function, call unsafe vsprintf() as fallback */ @@ -61,9 +61,9 @@ GMIO_INLINE int gmio_vsnprintf( * * snprintf() appeared in C99 */ -#ifdef GMIO_HAVE_SNPRINTF_FUNC +#ifdef GMIO_HAVE_SNPRINTF # define gmio_snprintf snprintf -#elif defined(GMIO_HAVE_WIN__SNPRINTF_FUNC) +#elif defined(GMIO_HAVE_WIN__SNPRINTF) # define gmio_snprintf _snprintf #else /* No snprintf()-like function, translate to gmio_vsnprintf() call */ diff --git a/src/gmio_core/internal/c99_stdlib_compat.h b/src/gmio_core/internal/c99_stdlib_compat.h index c2ed1ed..5d8e72f 100644 --- a/src/gmio_core/internal/c99_stdlib_compat.h +++ b/src/gmio_core/internal/c99_stdlib_compat.h @@ -33,7 +33,7 @@ #include -#ifdef GMIO_HAVE_STRTOF_FUNC +#ifdef GMIO_HAVE_STRTOF # define gmio_strtof strtof #else /* No strtof() function, call strtod() as fallback */ diff --git a/src/gmio_core/stream.c b/src/gmio_core/stream.c index a67b30e..92a8d3c 100644 --- a/src/gmio_core/stream.c +++ b/src/gmio_core/stream.c @@ -40,10 +40,10 @@ /* gmio_stat_t: type alias on the stat structure * GMIO_FSTAT_FUNC_NAME: alias on the fstat() function */ -# if defined(GMIO_HAVE_WIN__FSTAT64_FUNC) +# if defined(GMIO_HAVE_WIN__FSTAT64) typedef struct __stat64 gmio_stat_t; # define GMIO_FSTAT_FUNC_NAME _fstat64 -# elif defined(GMIO_HAVE_POSIX_FSTAT64_FUNC) +# elif defined(GMIO_HAVE_POSIX_FSTAT64) typedef struct stat64 gmio_stat_t; # define GMIO_FSTAT_FUNC_NAME fstat64 # else @@ -93,7 +93,7 @@ static gmio_streamsize_t gmio_stream_stdio_size(void* cookie) #if defined(GMIO_HAVE_SYS_TYPES_H) \ && defined(GMIO_HAVE_SYS_STAT_H) \ - && defined(GMIO_HAVE_POSIX_FILENO_FUNC) + && defined(GMIO_HAVE_POSIX_FILENO) const int fd = fileno(file); if (fd != -1) { From ef4498889705d8d634af6a5e6675b2d5af60e454 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 14 Apr 2017 09:24:37 +0200 Subject: [PATCH 6/6] gmio_stl: add documentation note for gmio_stl_infos_probe() --- src/gmio_stl/stl_infos.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gmio_stl/stl_infos.h b/src/gmio_stl/stl_infos.h index d18cac9..03c7da1 100644 --- a/src/gmio_stl/stl_infos.h +++ b/src/gmio_stl/stl_infos.h @@ -118,6 +118,8 @@ GMIO_C_LINKAGE_BEGIN * \p flags is a bitor combination of \c gmio_stl_info_flag values and is used * to select the informations to retrieve. * + * The position of the input stream is preserved. + * * \pre infos != NULL * \pre stream != NULL *