From 13234afc405e15fde56e4ca3840f87f350aea75d Mon Sep 17 00:00:00 2001 From: Martin Konrad Date: Tue, 12 Nov 2019 13:35:49 -0500 Subject: [PATCH] Simplify definition of compiler-specific macros Remove conditionals for older compiler versions that aren't supported by EPICS Base anymore. --- .../src/osi/compiler/gcc/compilerSpecific.h | 22 +++++-------------- .../src/osi/compiler/msvc/compilerSpecific.h | 13 ++--------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h index 13d91193c..e140d8b05 100644 --- a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h @@ -24,11 +24,7 @@ # error compiler/gcc/compilerSpecific.h is not for use with the clang compiler #endif -#if __GNUC__ > 2 -# define EPICS_ALWAYS_INLINE __inline__ __attribute__((always_inline)) -#else -# define EPICS_ALWAYS_INLINE __inline__ -#endif +#define EPICS_ALWAYS_INLINE __inline__ __attribute__((always_inline)) /* Expands to a 'const char*' which describes the name of the current function scope */ #define EPICS_FUNCTION __PRETTY_FUNCTION__ @@ -46,14 +42,8 @@ * CXX_PLACEMENT_DELETE - defined if compiler supports placement delete * CXX_THROW_SPECIFICATION - defined if compiler supports throw specification */ - -#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95 ) -# define CXX_THROW_SPECIFICATION -#endif - -#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 ) -# define CXX_PLACEMENT_DELETE -#endif +#define CXX_THROW_SPECIFICATION +#define CXX_PLACEMENT_DELETE #endif /* __cplusplus */ @@ -63,11 +53,9 @@ #define EPICS_PRINTF_STYLE(f,a) __attribute__((format(__printf__,f,a))) /* - * Deprecation marker if possible + * Deprecation marker */ -#if (__GNUC__ > 2) -# define EPICS_DEPRECATED __attribute__((deprecated)) -#endif +#define EPICS_DEPRECATED __attribute__((deprecated)) /* * Unused marker diff --git a/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h b/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h index 75bfa83fb..4e282db4b 100644 --- a/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h @@ -20,11 +20,7 @@ # error compiler/msvc/compilerSpecific.h is only for use with the Microsoft compiler #endif -#if _MSC_VER >= 1200 #define EPICS_ALWAYS_INLINE __forceinline -#else -#define EPICS_ALWAYS_INLINE __inline -#endif /* Expands to a 'const char*' which describes the name of the current function scope */ #define EPICS_FUNCTION __FUNCTION__ @@ -42,13 +38,8 @@ * CXX_PLACEMENT_DELETE - defined if compiler supports placement delete * CXX_THROW_SPECIFICATION - defined if compiler supports throw specification */ -#if _MSC_VER >= 1200 /* visual studio 6.0 or later */ -# define CXX_PLACEMENT_DELETE -#endif - -#if _MSC_VER > 1300 /* some release after visual studio 7 we hope */ -# define CXX_THROW_SPECIFICATION -#endif +#define CXX_PLACEMENT_DELETE +#define CXX_THROW_SPECIFICATION #endif /* __cplusplus */