From a12d22b7b36a15e3d05052a0709b222a964fed10 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 12 Dec 2020 15:03:38 +0100 Subject: [PATCH] tiffio.h: do not define __attribute__ but defines TIFF_ATTRIBUTE instead (fixes #221) --- libtiff/tiffio.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h index 221dfa5a..6274f098 100644 --- a/libtiff/tiffio.h +++ b/libtiff/tiffio.h @@ -261,8 +261,10 @@ typedef struct { #define LOGLUV_PUBLIC 1 #endif -#if !defined(__GNUC__) && !defined(__attribute__) -# define __attribute__(x) /*nothing*/ +#if defined(__GNUC__) || defined(__attribute__) +# define TIFF_ATTRIBUTE(x) __attribute__(x) +#else +# define TIFF_ATTRIBUTE(x) /*nothing*/ #endif #if defined(c_plusplus) || defined(__cplusplus) @@ -452,10 +454,10 @@ extern TIFF* TIFFClientOpen(const char*, const char*, TIFFMapFileProc, TIFFUnmapFileProc); extern const char* TIFFFileName(TIFF*); extern const char* TIFFSetFileName(TIFF*, const char *); -extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); +extern void TIFFError(const char*, const char*, ...) TIFF_ATTRIBUTE((__format__ (__printf__,2,3))); +extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) TIFF_ATTRIBUTE((__format__ (__printf__,3,4))); +extern void TIFFWarning(const char*, const char*, ...) TIFF_ATTRIBUTE((__format__ (__printf__,2,3))); +extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) TIFF_ATTRIBUTE((__format__ (__printf__,3,4))); extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt); extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);