diff options
author | Even Rouault <even.rouault@spatialys.com> | 2021-01-31 22:51:31 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2021-01-31 22:51:31 +0000 |
commit | 026cb785078c3f32ab4b4e36a14e64f646a00556 (patch) | |
tree | 91e95ccf4db97a3a9f0e771959c3ccdef6564f1d | |
parent | 8ac5d3bb77f7e9b0325465ba04ad5f5bb9bea925 (diff) | |
parent | 1cc7a7e153877d28b605e1fdecd6ec89c8fde393 (diff) | |
download | libtiff-git-026cb785078c3f32ab4b4e36a14e64f646a00556.tar.gz |
Merge branch 'c99-inline' into 'master'
Use C99 inline
See merge request libtiff/libtiff!215
-rw-r--r-- | CMakeLists.txt | 26 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | libtiff/tif_config.h.cmake.in | 6 | ||||
-rw-r--r-- | libtiff/tif_config.vc.h | 8 | ||||
-rw-r--r-- | libtiff/tif_fax3.c | 14 |
5 files changed, 2 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a939c95..66656d5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,32 +215,6 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(unistd.h HAVE_UNISTD_H) -# Inspired from /usr/share/autoconf/autoconf/c.m4 -foreach(inline_keyword "inline" "__inline__" "__inline") - if(NOT DEFINED C_INLINE) - set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS}) - set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - "-Dinline=${inline_keyword}") - check_c_source_compiles(" - typedef int foo_t; - static inline foo_t static_foo() {return 0;} - foo_t foo(){return 0;} - int main(int argc, char *argv[]) {return 0;}" - C_HAS_${inline_keyword}) - set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE}) - if(C_HAS_${inline_keyword}) - set(C_INLINE TRUE) - set(INLINE_KEYWORD "${inline_keyword}") - endif() - endif() -endforeach() -if(NOT DEFINED C_INLINE) - set(INLINE_KEYWORD) -endif() - -# off_t and size_t checks omitted; not clear they are used at all -# Are off_t and size_t checks strictly necessary? - # Check if sys/time.h and time.h allow use together check_c_source_compiles(" #include <sys/time.h> diff --git a/configure.ac b/configure.ac index e84cbf6b..e5c4f3dd 100644 --- a/configure.ac +++ b/configure.ac @@ -178,7 +178,6 @@ AC_CHECK_HEADERS([assert.h fcntl.h io.h search.h unistd.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST -AC_C_INLINE AC_C_BIGENDIAN AC_TYPE_OFF_T AC_TYPE_SIZE_T diff --git a/libtiff/tif_config.h.cmake.in b/libtiff/tif_config.h.cmake.in index dedc1675..b896e6da 100644 --- a/libtiff/tif_config.h.cmake.in +++ b/libtiff/tif_config.h.cmake.in @@ -155,12 +155,6 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@ -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#define inline @INLINE_KEYWORD@ -#endif - /* Define to `long int' if <sys/types.h> does not define. */ #undef off_t diff --git a/libtiff/tif_config.vc.h b/libtiff/tif_config.vc.h index 84b650da..e2f009d7 100644 --- a/libtiff/tif_config.vc.h +++ b/libtiff/tif_config.vc.h @@ -83,14 +83,6 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -# ifndef inline -# define inline __inline -# endif -#endif - #define lfind _lfind #pragma warning(disable : 4996) /* function deprecation warnings */ diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c index 49776812..736daa24 100644 --- a/libtiff/tif_fax3.c +++ b/libtiff/tif_fax3.c @@ -821,21 +821,11 @@ static const unsigned char oneruns[256] = { }; /* - * On certain systems it pays to inline - * the routines that find pixel spans. - */ -#ifdef VAXC -static int32_t find0span(unsigned char*, int32_t, int32_t); -static int32_t find1span(unsigned char*, int32_t, int32_t); -#pragma inline(find0span,find1span) -#endif - -/* * Find a span of ones or zeros using the supplied * table. The ``base'' of the bit string is supplied * along with the start+end bit indices. */ -inline static int32_t +static inline int32_t find0span(unsigned char* bp, int32_t bs, int32_t be) { int32_t bits = be - bs; @@ -897,7 +887,7 @@ find0span(unsigned char* bp, int32_t bs, int32_t be) return (span); } -inline static int32_t +static inline int32_t find1span(unsigned char* bp, int32_t bs, int32_t be) { int32_t bits = be - bs; |