mirror of https://github.com/ecmwf/eccodes.git
Enable the 'inline' directive based on ECCODES_HAVE_C_INLINE
This commit is contained in:
parent
47258f4920
commit
b3de64188b
|
@ -50,9 +50,9 @@ check_symbol_exists( fdatasync "unistd.h" ECCODES_HAVE_FDATASYNC)
|
|||
|
||||
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;}
|
||||
static inline foo_t static_foo(void){return 0;}
|
||||
foo_t foo(void){return 0;}
|
||||
int main(int argc, char *argv[]){ return static_foo(); }
|
||||
" ECCODES_HAVE_C_INLINE
|
||||
)
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#define ECCODES_DEFINITION_PATH "@ECCODES_DEFINITION_PATH@"
|
||||
|
||||
#cmakedefine ECCODES_HAVE_C_INLINE
|
||||
|
||||
#ifdef ECCODES_HAVE_C_INLINE
|
||||
#define GRIB_INLINE inline
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,7 @@ void grib_accessor_class_g2bitmap_t::init(grib_accessor* a, const long len, grib
|
|||
}
|
||||
|
||||
// For speed use a local static function
|
||||
static void set_bit_on(unsigned char* p, long* bitp)
|
||||
static GRIB_INLINE void set_bit_on(unsigned char* p, long* bitp)
|
||||
{
|
||||
p += *bitp / 8;
|
||||
*p |= (1u << (7 - ((*bitp) % 8)));
|
||||
|
|
Loading…
Reference in New Issue