Move default macros to compilerDependencies.h
Added check in gcc-specific header to error if __clang__ defined Some versions of clang don't support __has_attribute()
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -42,14 +41,5 @@
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Enable format-string checking if possible
|
||||
*/
|
||||
#define EPICS_PRINTF_STYLE(f,a)
|
||||
|
||||
/*
|
||||
* Deprecation marker
|
||||
*/
|
||||
#define EPICS_DEPRECATED
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -21,12 +20,6 @@
|
||||
# error compiler/clang/compilerSpecific.h is only for use with the clang compiler
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WARNING: the current state of this file is only based on reading clang manuals
|
||||
* and has not actually been tested with the compiler
|
||||
*/
|
||||
#pragma warning compiler/clang/compilerSpecific.h is based on reading the manual, but hasnt been tested with the clang compiler
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/*
|
||||
@@ -39,21 +32,18 @@
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Enable format-string checking if possible
|
||||
* __has_attribute() is not supported on all versions of clang yet
|
||||
*/
|
||||
#if __has_attribute(format)
|
||||
# define EPICS_PRINTF_STYLE(f,a) __attribute__((format(__printf__,f,a)))
|
||||
#else
|
||||
# define EPICS_PRINTF_STYLE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deprecation marker if possible
|
||||
* Enable format-string checking
|
||||
*/
|
||||
#if __has_attribute(deprecated)
|
||||
# define EPICS_DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
# define EPICS_DEPRECATED
|
||||
#endif
|
||||
#define EPICS_PRINTF_STYLE(f,a) __attribute__((format(__printf__,f,a)))
|
||||
|
||||
/*
|
||||
* Deprecation marker
|
||||
*/
|
||||
#define EPICS_DEPRECATED __attribute__((deprecated))
|
||||
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -30,16 +29,5 @@
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Enable format-string checking if possible
|
||||
* (our default guess is that the compiler doesnt implement non-standard extensions)
|
||||
*/
|
||||
#define EPICS_PRINTF_STYLE(f,a)
|
||||
|
||||
/*
|
||||
* Deprecation marker
|
||||
* (our default guess is that the compiler doesnt implement non-standard extensions)
|
||||
*/
|
||||
#define EPICS_DEPRECATED
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -20,6 +19,10 @@
|
||||
#ifndef __GNUC__
|
||||
# error compiler/gcc/compilerSpecific.h is only for use with the gnu compiler
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
# error compiler/gcc/compilerSpecific.h is not for use with the clang compiler
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -55,8 +58,7 @@
|
||||
*/
|
||||
#if (__GNUC__ > 2)
|
||||
# define EPICS_DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
# define EPICS_DEPRECATED
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -44,14 +43,5 @@
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Enable format-string checking if possible
|
||||
*/
|
||||
#define EPICS_PRINTF_STYLE(f,a)
|
||||
|
||||
/*
|
||||
* Deprecation marker
|
||||
*/
|
||||
#define EPICS_DEPRECATED
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
@@ -44,4 +43,20 @@
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#ifndef EPICS_PRINTF_STYLE
|
||||
/*
|
||||
* No format-string checking
|
||||
*/
|
||||
# define EPICS_PRINTF_STYLE(f,a)
|
||||
#endif
|
||||
|
||||
#ifndef EPICS_DEPRECATED
|
||||
/*
|
||||
* No deprecation markers
|
||||
*/
|
||||
#define EPICS_DEPRECATED
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* ifndef compilerDependencies_h */
|
||||
|
||||
Reference in New Issue
Block a user