Build fdopen(), hypot(), putenv() in libc.
authorGeorge Koehler <xkernigh@netscape.net>
Sat, 28 Oct 2017 17:06:38 +0000 (13:06 -0400)
committerGeorge Koehler <xkernigh@netscape.net>
Sat, 28 Oct 2017 17:33:57 +0000 (13:33 -0400)
These functions are in POSIX; hypot() is in C99.  Also build cabs()
because it rides with hypot(), but don't declare cabs() in any header
file, because our compiler can't parse C99 "double complex" type.

Touch build.lua so it sees that .c files moved.

lang/cem/libcc.ansi/build.lua
lang/cem/libcc.ansi/headers/math.h
lang/cem/libcc.ansi/math/hypot.c [moved from lang/cem/libcc.ansi/misc/hypot.c with 100% similarity]
lang/cem/libcc.ansi/stdio/fdopen.c [moved from lang/cem/libcc.ansi/misc/fdopen.c with 100% similarity]
lang/cem/libcc.ansi/stdlib/putenv.c [moved from lang/cem/libcc.ansi/misc/putenv.c with 100% similarity]

index 20591f8..a0d6eeb 100644 (file)
@@ -37,7 +37,7 @@ for _, plat in ipairs(vars.plats) do
                        "./errno/*.c",
                        "./locale/*.c",
                        "./malloc/*.c",
-                       "./math/*.c",
+                       "./math/*.c", -- hypot.c
                        "./math/*.e",
                        "./misc/environ.c", -- don't build everything here as it's all obsolete
                        "./setjmp/*.c",
index 3546b04..f82c559 100644 (file)
@@ -33,6 +33,7 @@ extern double ceil(double _x);
 extern double fabs(double _x);
 extern double floor(double _x);
 
+extern double hypot(double _x, double _y);
 extern double pow(double _x, double _y);
 
 extern double frexp(double _x, int *_exp);