Skip to content

Commit

Permalink
add intel specific DEPRECATED macros
Browse files Browse the repository at this point in the history
  • Loading branch information
svenevs committed Sep 11, 2018
1 parent 88a7adc commit 12efd4f
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions common/include/pcl/pcl_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,22 +321,19 @@ log2f (float x)
#define __has_extension(x) 0 // Compatibility with pre-3.0 compilers.
#endif

#if (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) < PCL_LINEAR_VERSION(4,5,0) && ! defined(__clang__)) || defined(__INTEL_COMPILER)
#define PCL_DEPRECATED(message) __attribute__ ((deprecated))
#endif

// check Intel compiler first since it usually also defines __GNUC__, __clang__, etc.
#if defined(__INTEL_COMPILER)
#define PCL_DEPRECATED(message) __attribute((deprecated))
#elif (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) < PCL_LINEAR_VERSION(4,5,0) && ! defined(__clang__)) || defined(__INTEL_COMPILER)
#define PCL_DEPRECATED(message) __attribute__ ((deprecated))
// gcc supports this starting from 4.5 : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43666
#if (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) >= PCL_LINEAR_VERSION(4,5,0)) || (defined(__clang__) && __has_extension(attribute_deprecated_with_message))
#define PCL_DEPRECATED(message) __attribute__ ((deprecated(message)))
#endif

#ifdef _MSC_VER
#define PCL_DEPRECATED(message) __declspec(deprecated(message))
#endif

#ifndef PCL_DEPRECATED
#pragma message("WARNING: You need to implement PCL_DEPRECATED for this compiler")
#define PCL_DEPRECATED(message)
#elif (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) >= PCL_LINEAR_VERSION(4,5,0)) || (defined(__clang__) && __has_extension(attribute_deprecated_with_message))
#define PCL_DEPRECATED(message) __attribute__ ((deprecated(message)))
#elif defined(_MSC_VER)
#define PCL_DEPRECATED(message) __declspec(deprecated(message))
#else
#pragma message("WARNING: You need to implement PCL_DEPRECATED for this compiler")
#define PCL_DEPRECATED(message)
#endif


Expand All @@ -356,22 +353,19 @@ log2f (float x)
// NewClass() {}
// };

#if (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) < PCL_LINEAR_VERSION(4,5,0) && ! defined(__clang__)) || defined(__INTEL_COMPILER)
#define PCL_DEPRECATED_CLASS(func, message) __attribute__ ((deprecated)) func
#endif

// check Intel compiler first since it usually also defines __GNUC__, __clang__, etc.
#if defined(__INTEL_COMPILER)
#define PCL_DEPRECATED_CLASS(func, message) __attribute((deprecated)) func
#elif (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) < PCL_LINEAR_VERSION(4,5,0) && ! defined(__clang__)) || defined(__INTEL_COMPILER)
#define PCL_DEPRECATED_CLASS(func, message) __attribute__ ((deprecated)) func
// gcc supports this starting from 4.5 : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43666
#if (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) >= PCL_LINEAR_VERSION(4,5,0)) || (defined(__clang__) && __has_extension(attribute_deprecated_with_message))
#define PCL_DEPRECATED_CLASS(func, message) __attribute__ ((deprecated(message))) func
#endif

#ifdef _MSC_VER
#define PCL_DEPRECATED_CLASS(func, message) __declspec(deprecated(message)) func
#endif

#ifndef PCL_DEPRECATED_CLASS
#pragma message("WARNING: You need to implement PCL_DEPRECATED_CLASS for this compiler")
#define PCL_DEPRECATED_CLASS(func) func
#elif (defined(__GNUC__) && PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) >= PCL_LINEAR_VERSION(4,5,0)) || (defined(__clang__) && __has_extension(attribute_deprecated_with_message))
#define PCL_DEPRECATED_CLASS(func, message) __attribute__ ((deprecated(message))) func
#elif defined(_MSC_VER)
#define PCL_DEPRECATED_CLASS(func, message) __declspec(deprecated(message)) func
#else
#pragma message("WARNING: You need to implement PCL_DEPRECATED_CLASS for this compiler")
#define PCL_DEPRECATED_CLASS(func) func
#endif

#if defined (__GNUC__) || defined (__PGI) || defined (__IBMCPP__) || defined (__SUNPRO_CC)
Expand Down

0 comments on commit 12efd4f

Please sign in to comment.