about summary refs log tree commit diff
path: root/math/complex.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-01-08 10:07:26 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-08 10:07:26 -0500
commitac097f5cd08c8e60097297bd51e04f4fe1b25cc0 (patch)
treefbf68ae6835f3794e0e61c12677bb0e6c914586c /math/complex.h
parent2119dcfaccfa6fabf9e6be15f6d97ad041252ac9 (diff)
downloadglibc-ac097f5cd08c8e60097297bd51e04f4fe1b25cc0.tar.gz
glibc-ac097f5cd08c8e60097297bd51e04f4fe1b25cc0.tar.xz
glibc-ac097f5cd08c8e60097297bd51e04f4fe1b25cc0.zip
Define CMPLX, CMPLXF, CMPLXL
Diffstat (limited to 'math/complex.h')
-rw-r--r--math/complex.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/math/complex.h b/math/complex.h
index cc6006e760..9cbcc7f7d0 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2006, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2000, 2006, 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,6 +49,15 @@ __BEGIN_DECLS
 #undef I
 #define I _Complex_I
 
+#if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7)
+/* Macros to expand into expression of specified complex type.  */
+# define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))
+# define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y))
+# ifndef __NO_LONG_DOUBLE_MATH
+#  define CMPLXL(x, y) __builtin_complex ((double) (x), (double) (y))
+# endif
+#endif
+
 /* The file <bits/cmathcalls.h> contains the prototypes for all the
    actual math functions.  These macros are used for those prototypes,
    so we can easily declare each function as both `name' and `__name',