From 2350e20cae1a9a1f54147c6e18e1a0da706cca96 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Mar 2019 14:04:32 -0400 Subject: [PATCH] mathlimits: remove no-op macro expansion code --- src/google/protobuf/stubs/mathlimits.cc | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/google/protobuf/stubs/mathlimits.cc b/src/google/protobuf/stubs/mathlimits.cc index a92401e714..7a335bd6c5 100644 --- a/src/google/protobuf/stubs/mathlimits.cc +++ b/src/google/protobuf/stubs/mathlimits.cc @@ -40,11 +40,6 @@ namespace google { namespace protobuf { -#define DEF_COMMON_LIMITS(Type) -#define DEF_UNSIGNED_INT_LIMITS(Type) -#define DEF_SIGNED_INT_LIMITS(Type) -#define DEF_PRECISION_LIMITS(Type) - // http://en.wikipedia.org/wiki/Quadruple_precision_floating-point_format#Double-double_arithmetic // With some compilers (gcc 4.6.x) on some platforms (powerpc64), // "long double" is implemented as a pair of double: "double double" format. @@ -70,7 +65,6 @@ namespace protobuf { // max(DBL_EPSILON * DBL_EPSILON, kEpsilon) rather than a multiple of kEpsilon. #define DEF_FP_LIMITS(Type, PREFIX) \ -DEF_COMMON_LIMITS(Type) \ const Type MathLimits::kPosMin = PREFIX##_MIN; \ const Type MathLimits::kPosMax = PREFIX##_MAX; \ const Type MathLimits::kMin = -MathLimits::kPosMax; \ @@ -82,32 +76,14 @@ const Type MathLimits::kEpsilon = PREFIX##_EPSILON; \ const Type MathLimits::kStdError = \ 32 * (DBL_EPSILON * DBL_EPSILON > MathLimits::kEpsilon \ ? DBL_EPSILON * DBL_EPSILON : MathLimits::kEpsilon); \ -DEF_PRECISION_LIMITS(Type) \ const Type MathLimits::kNaN = HUGE_VAL - HUGE_VAL; \ const Type MathLimits::kPosInf = HUGE_VAL; \ const Type MathLimits::kNegInf = -HUGE_VAL; -// The following are *not* casts! -DEF_SIGNED_INT_LIMITS(int8) -DEF_SIGNED_INT_LIMITS(int16) // NOLINT(readability/casting) -DEF_SIGNED_INT_LIMITS(int32) // NOLINT(readability/casting) -DEF_SIGNED_INT_LIMITS(int64) // NOLINT(readability/casting) -DEF_UNSIGNED_INT_LIMITS(uint8) -DEF_UNSIGNED_INT_LIMITS(uint16) // NOLINT(readability/casting) -DEF_UNSIGNED_INT_LIMITS(uint32) // NOLINT(readability/casting) -DEF_UNSIGNED_INT_LIMITS(uint64) // NOLINT(readability/casting) - -DEF_SIGNED_INT_LIMITS(long int) -DEF_UNSIGNED_INT_LIMITS(unsigned long int) - DEF_FP_LIMITS(float, FLT) DEF_FP_LIMITS(double, DBL) DEF_FP_LIMITS(long double, LDBL); -#undef DEF_COMMON_LIMITS -#undef DEF_SIGNED_INT_LIMITS -#undef DEF_UNSIGNED_INT_LIMITS #undef DEF_FP_LIMITS -#undef DEF_PRECISION_LIMITS } // namespace protobuf } // namespace google