add EPICS_ALWAYS_INLINE

This commit is contained in:
Michael Davidsaver
2015-02-27 17:29:10 -05:00
parent 7fe5f2f3a3
commit b3bfac3f16
5 changed files with 69 additions and 0 deletions

View File

@@ -20,6 +20,12 @@
# error compiler/clang/compilerSpecific.h is only for use with the clang compiler
#endif
#if __has_attribute(always_inline)
#define EPICS_ALWAYS_INLINE __inline__ __attribute__((always_inline))
#else
#define EPICS_ALWAYS_INLINE __inline__
#endif
#ifdef __cplusplus
/*

View File

@@ -15,6 +15,14 @@
#ifndef compilerSpecific_h
#define compilerSpecific_h
/* The 'inline' key work, possibily with compiler
* dependent flags to force inlineing where it would
* otherwise not be done.
*
* Warning: Second guessing the compiler may result in larger code size
*/
#define EPICS_ALWAYS_INLINE inline
#ifdef __cplusplus

View File

@@ -23,6 +23,12 @@
#ifdef __clang__
# 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
#ifdef __cplusplus

View File

@@ -20,6 +20,12 @@
# 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
#ifdef __cplusplus
/*

View File

@@ -0,0 +1,43 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author:
* Jeffrey O. Hill
* johill@lanl.gov
*/
#ifndef compilerSpecific_h
#define compilerSpecific_h
#ifndef __SUNPRO_C
# error Not Solaris Studio
#endif
#if __SUNPRO_C<0x590
# define EPICS_ALWAYS_INLINE inline
#else
# define EPICS_ALWAYS_INLINE inline __attribute__((always_inline))
#endif
#ifdef __cplusplus
/*
* CXX_PLACEMENT_DELETE - defined if compiler supports placement delete
* CXX_THROW_SPECIFICATION - defined if compiler supports throw specification
*
* (our default guess is that the compiler implements the C++ 97 standard)
*/
#define CXX_THROW_SPECIFICATION
#define CXX_PLACEMENT_DELETE
#endif /* __cplusplus */
#endif /* ifndef compilerSpecific_h */