Refactor out common pre-processor code.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@78037 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/int_lib.h b/lib/int_lib.h
index e836550..3690d2e 100644
--- a/lib/int_lib.h
+++ b/lib/int_lib.h
@@ -19,6 +19,11 @@
 // Assumption:  right shift of signed negative is arithmetic shift
 
 #include <limits.h>
+#include <math.h>
+
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
 
 // TODO: Improve this to minimal pre-processor hackish'ness.
 #if defined (__SVR4) && defined (__sun)