summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/CMakeLists.txt4
-rw-r--r--compiler-rt/lib/divdc3.c4
-rw-r--r--compiler-rt/lib/divsc3.c4
-rw-r--r--compiler-rt/lib/divxc3.c4
-rw-r--r--compiler-rt/lib/floatundidf.c2
-rw-r--r--compiler-rt/lib/int_lib.h28
-rw-r--r--compiler-rt/lib/muldc3.c4
-rw-r--r--compiler-rt/lib/mulsc3.c4
-rw-r--r--compiler-rt/lib/mulxc3.c4
9 files changed, 57 insertions, 1 deletions
diff --git a/compiler-rt/lib/CMakeLists.txt b/compiler-rt/lib/CMakeLists.txt
index 56a9b94ae8d..ec789504ab1 100644
--- a/compiler-rt/lib/CMakeLists.txt
+++ b/compiler-rt/lib/CMakeLists.txt
@@ -1,6 +1,10 @@
#
# Create a library called "CompilerRT" which includes the source files.
+#INCLUDE_DIRECTORIES(
+# ${CMAKE_CURRENT_BINARY_DIR}
+#)
+
# Generic functions needed for each architecture
SET( SRCS
diff --git a/compiler-rt/lib/divdc3.c b/compiler-rt/lib/divdc3.c
index 1b19e665f61..ccdf526a886 100644
--- a/compiler-rt/lib/divdc3.c
+++ b/compiler-rt/lib/divdc3.c
@@ -15,6 +15,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the quotient of (a + ib) / (c + id)
double _Complex
diff --git a/compiler-rt/lib/divsc3.c b/compiler-rt/lib/divsc3.c
index bea15cdc4e0..f2529970c28 100644
--- a/compiler-rt/lib/divsc3.c
+++ b/compiler-rt/lib/divsc3.c
@@ -15,6 +15,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the quotient of (a + ib) / (c + id)
float _Complex
diff --git a/compiler-rt/lib/divxc3.c b/compiler-rt/lib/divxc3.c
index 4ee09b9dbb6..982397f5f12 100644
--- a/compiler-rt/lib/divxc3.c
+++ b/compiler-rt/lib/divxc3.c
@@ -17,6 +17,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the quotient of (a + ib) / (c + id)
long double _Complex
diff --git a/compiler-rt/lib/floatundidf.c b/compiler-rt/lib/floatundidf.c
index f019d693ba5..708d614aca4 100644
--- a/compiler-rt/lib/floatundidf.c
+++ b/compiler-rt/lib/floatundidf.c
@@ -98,4 +98,4 @@ __floatundidf(du_int a)
fb.u.low = (su_int)a; // mantissa-low
return fb.f;
}
-#endif \ No newline at end of file
+#endif
diff --git a/compiler-rt/lib/int_lib.h b/compiler-rt/lib/int_lib.h
index 7d09c856f5e..e8365506f3a 100644
--- a/compiler-rt/lib/int_lib.h
+++ b/compiler-rt/lib/int_lib.h
@@ -20,6 +20,34 @@
#include <limits.h>
+// TODO: Improve this to minimal pre-processor hackish'ness.
+#if defined (__SVR4) && defined (__sun)
+// config.h build via CMake.
+//#include <config.h>
+
+// Solaris header for endian and byte swap
+//#if defined HAVE_SYS_BYTEORDER_H
+#include <sys/byteorder.h>
+
+// Solaris defines endian by setting _LITTLE_ENDIAN or _BIG_ENDIAN
+#ifdef _BIG_ENDIAN
+# define IS_BIG_ENDIAN
+#endif
+#ifdef _LITTLE_ENDIAN
+# define IS_LITTLE_ENDIAN
+#endif
+
+#ifdef IS_BIG_ENDIAN
+#define __BIG_ENDIAN__ 1
+#define __LITTLE_ENDIAN__ 0
+#endif
+#ifdef IS_LITTLE_ENDIAN
+#define __BIG_ENDIAN__ 0
+#define __LITTLE_ENDIAN__ 1
+#endif
+
+#endif //End of Solaris ifdef.
+
#ifdef __LITTLE_ENDIAN__
#if __LITTLE_ENDIAN__
#define _YUGA_LITTLE_ENDIAN 1
diff --git a/compiler-rt/lib/muldc3.c b/compiler-rt/lib/muldc3.c
index b945e8e3827..3549823c2ef 100644
--- a/compiler-rt/lib/muldc3.c
+++ b/compiler-rt/lib/muldc3.c
@@ -15,6 +15,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the product of a + ib and c + id
double _Complex
diff --git a/compiler-rt/lib/mulsc3.c b/compiler-rt/lib/mulsc3.c
index bc47a47ea41..c723032cd73 100644
--- a/compiler-rt/lib/mulsc3.c
+++ b/compiler-rt/lib/mulsc3.c
@@ -15,6 +15,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the product of a + ib and c + id
float _Complex
diff --git a/compiler-rt/lib/mulxc3.c b/compiler-rt/lib/mulxc3.c
index e38ab0dcf6e..840e458b9ae 100644
--- a/compiler-rt/lib/mulxc3.c
+++ b/compiler-rt/lib/mulxc3.c
@@ -17,6 +17,10 @@
#include <math.h>
#include <complex.h>
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
// Returns: the product of a + ib and c + id
long double _Complex
OpenPOWER on IntegriCloud