From: George Koehler Date: Sat, 28 Oct 2017 17:06:38 +0000 (-0400) Subject: Build fdopen(), hypot(), putenv() in libc. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b00a2c906d1f11f6d1aa52b0388d467fda0c6b60;p=ack.git Build fdopen(), hypot(), putenv() in libc. 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. --- diff --git a/lang/cem/libcc.ansi/build.lua b/lang/cem/libcc.ansi/build.lua index 20591f803..a0d6eebc1 100644 --- a/lang/cem/libcc.ansi/build.lua +++ b/lang/cem/libcc.ansi/build.lua @@ -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", diff --git a/lang/cem/libcc.ansi/headers/math.h b/lang/cem/libcc.ansi/headers/math.h index 3546b042c..f82c55916 100644 --- a/lang/cem/libcc.ansi/headers/math.h +++ b/lang/cem/libcc.ansi/headers/math.h @@ -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); diff --git a/lang/cem/libcc.ansi/misc/hypot.c b/lang/cem/libcc.ansi/math/hypot.c similarity index 100% rename from lang/cem/libcc.ansi/misc/hypot.c rename to lang/cem/libcc.ansi/math/hypot.c diff --git a/lang/cem/libcc.ansi/misc/fdopen.c b/lang/cem/libcc.ansi/stdio/fdopen.c similarity index 100% rename from lang/cem/libcc.ansi/misc/fdopen.c rename to lang/cem/libcc.ansi/stdio/fdopen.c diff --git a/lang/cem/libcc.ansi/misc/putenv.c b/lang/cem/libcc.ansi/stdlib/putenv.c similarity index 100% rename from lang/cem/libcc.ansi/misc/putenv.c rename to lang/cem/libcc.ansi/stdlib/putenv.c