From 08f9869a63d85a4634ec87c826212b01f935af8e Mon Sep 17 00:00:00 2001 From: George Koehler Date: Sun, 6 Nov 2016 15:49:47 -0500 Subject: [PATCH] Remove unused defines from lang/cem/libcc.ansi/math/localmath.h This undoes part of bfeb736, and returns to using DBL_MAX_EXP and DBL_MIN_EXP from float.h. Add a dependency on math/localmath.h and other local header files so libc is rebuilt when those headers change. --- lang/cem/libcc.ansi/build.lua | 20 ++++++++++++-------- lang/cem/libcc.ansi/math/localmath.h | 17 ++--------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/lang/cem/libcc.ansi/build.lua b/lang/cem/libcc.ansi/build.lua index 3ca95b629..601a50de4 100644 --- a/lang/cem/libcc.ansi/build.lua +++ b/lang/cem/libcc.ansi/build.lua @@ -28,9 +28,9 @@ normalrule { } for _, plat in ipairs(vars.plats) do - acklibrary { - name = "lib_"..plat, - srcs = { + acklibrary { + name = "lib_"..plat, + srcs = { "+ctype_files", "+ctype_tab", "./ctype/*.c", @@ -43,20 +43,24 @@ for _, plat in ipairs(vars.plats) do "./setjmp/*.c", "./setjmp/*.e", "./signal/*.c", - "./assert/*.c", + "./assert/*.c", "./stdio/*.c", "./stdlib/*.c", "./string/*.c", "./time/*.c", - - }, + }, hdrs = {}, -- must be empty deps = { "lang/cem/libcc.ansi/headers+headers", "plat/"..plat.."/include+headers", + "./malloc/malloc.h", + "./math/localmath.h", + "./stdio/loc_incl.h", + "./stdlib/ext_fmt.h", + "./time/loc_time.h", }, - vars = { plat = plat } - } + vars = { plat = plat } + } ackfile { name = "crt_"..plat, diff --git a/lang/cem/libcc.ansi/math/localmath.h b/lang/cem/libcc.ansi/math/localmath.h index 7c9a67465..e85c81c0a 100644 --- a/lang/cem/libcc.ansi/math/localmath.h +++ b/lang/cem/libcc.ansi/math/localmath.h @@ -18,18 +18,5 @@ #define POLYNOM12(x, a) (POLYNOM11((x),(a)+1)*(x)+(a)[0]) #define POLYNOM13(x, a) (POLYNOM12((x),(a)+1)*(x)+(a)[0]) -/* These are set up for 64-bit doubles. */ - -#ifndef M_MAX_D -#define M_MAX_D 1.7976931348623157e+308 -#define M_MIN_D 2.2250738585072014e-308 -#define M_DEXPLEN 11 -#endif -#define M_DMAXEXP ((1 << (M_DEXPLEN - 1)) - 1) -#define M_DMINEXP (-M_DMAXEXP) -#define M_LN_MAX_D (M_LN2 * M_DMAXEXP) -#define M_LN_MIN_D (M_LN2 * (M_DMINEXP - 1)) - -#define HUGE M_MAX_D -#define MAXDOUBLE M_MAX_D - +#define M_LN_MAX_D (M_LN2 * DBL_MAX_EXP) +#define M_LN_MIN_D (M_LN2 * (DBL_MIN_EXP - 1))