[trunk] Move INLINE definition within openjpeg.h header since application may use it
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 12:02:05 +0000 (12:02 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 12:02:05 +0000 (12:02 +0000)
src/bin/jp2/convert.c
src/lib/openjp2/openjpeg.h
src/lib/openjp2/opj_includes.h

index 90684a2c69582950e1d6fde58ce750872b7924d7..5dd09da72e6a5486479a295a2ce93af7d6720a84 100644 (file)
@@ -183,7 +183,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
 
 #if WORDS_BIGENDIAN == 1
 
-static inline int16_t swap16(int16_t x)
+static INLINE int16_t swap16(int16_t x)
 {
     return((((u_int16_t)x & 0x00ffU) <<  8) |
            (((u_int16_t)x & 0xff00U) >>  8));
@@ -1421,13 +1421,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters) {
 
 #define CLAMP(x,a,b) x < a ? a : (x > b ? b : x)
 
-#ifdef _MSC_VER
-#define STIN static __inline
-#else
-#define STIN static inline
-#endif
-
-STIN int clamp( const int value, const int prec, const int sgnd )
+static INLINE int clamp( const int value, const int prec, const int sgnd )
 {
   if( sgnd )
     {
index d3339954d26f64dbd0590cb0801a27df94839e5a..59a1cdc463a9744b83b7fac833bc5ed2c7ce81bd 100644 (file)
 ==========================================================
 */
 
+/*
+The inline keyword is supported by C99 but not by C90. 
+Most compilers implement their own version of this keyword ... 
+*/
+#ifndef INLINE
+       #if defined(_MSC_VER)
+               #define INLINE __forceinline
+       #elif defined(__GNUC__)
+               #define INLINE __inline__
+       #elif defined(__MWERKS__)
+               #define INLINE inline
+       #else 
+               /* add other compilers here ... */
+               #define INLINE 
+       #endif /* defined(<Compiler>) */
+#endif /* INLINE */
+
 /* deprecated attribute */
 #ifdef __GNUC__
        #define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))
index 8b072c5853b3e7e4d4ef61a3282a6a38d11beec0..76380962f972761be4f94c440cdcdfd3ecb42886 100644 (file)
        #define __attribute__(x) /* __attribute__(x) */
 #endif
 
-/*
-The inline keyword is supported by C99 but not by C90. 
-Most compilers implement their own version of this keyword ... 
-*/
-#ifndef INLINE
-       #if defined(_MSC_VER)
-               #define INLINE __forceinline
-       #elif defined(__GNUC__)
-               #define INLINE __inline__
-       #elif defined(__MWERKS__)
-               #define INLINE inline
-       #else 
-               /* add other compilers here ... */
-               #define INLINE 
-       #endif /* defined(<Compiler>) */
-#endif /* INLINE */
 
 /* Are restricted pointers available? (C99) */
 #if (__STDC_VERSION__ != 199901L)