diff mbox

Add the __builtin functions needed for INFINITY and nan().

Message ID 20150311231919.GA14617@redhat.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Michael Stefaniuc March 11, 2015, 11:19 p.m. UTC
Signed-off-by: Michael Stefaniuc <mstefani@redhat.com>
---
Needed for Wine. Not all of those but have added them for completeness.


 lib.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/lib.c b/lib.c
index 8dc5bcf..58a7f2e 100644
--- a/lib.c
+++ b/lib.c
@@ -876,6 +876,17 @@  void declare_builtin_functions(void)
 	add_pre_buffer("extern int __builtin_islessgreater(float, float);\n");
 	add_pre_buffer("extern int __builtin_isunordered(float, float);\n");
 
+	/* And some INFINITY / NAN stuff.. */
+	add_pre_buffer("extern double __builtin_huge_val(void);\n");
+	add_pre_buffer("extern float __builtin_huge_valf(void);\n");
+	add_pre_buffer("extern long double __builtin_huge_vall(void);\n");
+	add_pre_buffer("extern double __builtin_inf(void);\n");
+	add_pre_buffer("extern float __builtin_inff(void);\n");
+	add_pre_buffer("extern long double __builtin_infl(void);\n");
+	add_pre_buffer("extern double __builtin_nan(const char *);\n");
+	add_pre_buffer("extern float __builtin_nanf(const char *);\n");
+	add_pre_buffer("extern long double __builtin_nanl(const char *);\n");
+
 	/* And some __FORTIFY_SOURCE ones.. */
 	add_pre_buffer ("extern __SIZE_TYPE__ __builtin_object_size(void *, int);\n");
 	add_pre_buffer ("extern void * __builtin___memcpy_chk(void *, const void *, __SIZE_TYPE__, __SIZE_TYPE__);\n");