+2014-01-27 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Re-establish pattern rules for %_generic.c; (cf. issue #2175)
+
+ * src/libcrt/math/round.c: Delete it; this kludgey stub isn't needed.
+ * src/libcrt/math/roundf.c src/libcrt/math/roundl.c: Likewise.
+ * src/libcrt/math/lround.c src/libcrt/math/lroundf.c: Likewise.
+ * src/libcrt/math/lroundl.c: Likewise.
+
+ * src/libcrt/math/asinh.c: Rename to...
+ * src/libcrt/math/asinh_generic.c: ...this; compliance with the
+ math_generic.c naming convention is imperative.
+
+ * src/libcrt/math/round_generic.c: Reinstate author attribution.
+ * src/libcrt/math/lround_generic.c: Likewise.
+
+ * Makefile.in (math_SOURCES): Remove references to deleted files; add
+ references to corresponding %_generic.c sources, in their place.
+ (libmingwex_a_OBJECTS): Filter %_generic references, to generate the
+ corresponding %.o, %f.o, and %l.o references; append llround%.o set.
+ Adjust pattern rules to build each set of three; add a static pattern
+ rule, to accommodate special requirements of the llround% set.
+
2014-01-22 Keith Marshall <keithmarshall@users.sourceforge.net>
Reinstate complex math functions; (cf. issue #2174)
$(SRCDIR)/acoshl.c \
$(SRCDIR)/acosl.c \
$(SRCDIR)/asinf.c \
- $(SRCDIR)/asinh.c \
+ $(SRCDIR)/asinh_generic.c \
$(SRCDIR)/asinl.c \
$(SRCDIR)/atan2f.c \
$(SRCDIR)/atan2l.c \
$(SRCDIR)/lrint.c \
$(SRCDIR)/lrintf.c \
$(SRCDIR)/lrintl.c \
- $(SRCDIR)/lround.c \
- $(SRCDIR)/lroundl.c \
- $(SRCDIR)/lroundf.c \
+ $(SRCDIR)/lround_generic.c \
$(SRCDIR)/modff.c \
$(SRCDIR)/modfl.c \
$(SRCDIR)/nearbyint.S \
$(SRCDIR)/rint.c \
$(SRCDIR)/rintf.c \
$(SRCDIR)/rintl.c \
- $(SRCDIR)/round.c \
- $(SRCDIR)/roundf.c \
- $(SRCDIR)/roundl.c \
+ $(SRCDIR)/round_generic.c \
$(MSRCDIR)/s_erf.c \
$(SRCDIR)/scalbn.S \
$(SRCDIR)/scalbnf.S \
$(wchar_SOURCES) \
$(wctype_SOURCES)
libmingwex_a_OBJECTS := $(libmingwex_a_SOURCES:.c=.o)
-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o)
-
-SRCDIR := src/libcrt/math
-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhl.o
-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhf.o
+libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o) \
+ src/libcrt/math/llround_generic.o
+libmingwex_a_generic_objects := $(filter %_generic.o,$(libmingwex_a_OBJECTS))
+libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:%_generic.o=%.o) \
+ $(libmingwex_a_generic_objects:%_generic.o=%f.o) \
+ $(libmingwex_a_generic_objects:%_generic.o=%l.o)
+libmingwex_a_OBJECTS := $(sort $(libmingwex_a_OBJECTS))
SRCDIR := misc/src/libdinput
libdinput_a_SOURCES := \
$(MKDIR_P) $(@D)
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
+# For the math sources, we support the convention that a single
+# quux_generic.c source file will produce three objects: quux.o,
+# quuxf.o, and quuxl.o; since a change in the common source file
+# will require all three objects to be recompiled, we may handle
+# this with a single, multiple target, pattern rule.
+#
SRCDIR := src/libcrt/math
-$(SRCDIR)/%f.o: $(SRCDIR)/%.c
+$(SRCDIR)/%.o $(SRCDIR)/%f.o $(SRCDIR)/%l.o: $(SRCDIR)/%_generic.c
$(MKDIR_P) $(@D)
- $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
-
-$(SRCDIR)/%l.o: $(SRCDIR)/%.c
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*.o $<
+ $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $<
+ $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $<
+
+# The llround.o, llroundf.o, and llroundl.o variants are a special
+# case of the preceding rule; (the source is lround_generic.c rather
+# than llround_generic.c). We can handle this using the following
+# static pattern rule, (again, compiling all three objects).
+#
+$(SRCDIR)/llroundf.o $(SRCDIR)/llroundl.o: $(SRCDIR)/llround.o
+$(SRCDIR)/llround.o: $(SRCDIR)/%.o: $(SRCDIR)/lround_generic.c
$(MKDIR_P) $(@D)
- $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
+ $(CC) -c -D FUNCTION=$* $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
+ $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $<
+ $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $<
SRCDIR := src/libcrt/crt
$(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o:
/**
- * @file asinh.c
+ * @file asinh_generic.c
* Copyright 2012, 2013 MinGW.org project
*
* Permission is hereby granted, free of charge, to any person obtaining a
+++ /dev/null
-/**
- * @file lround.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION lround
-#include "lround_generic.c"
/**
* @file lround_generic.c
- * Copyright 2012, 2013 MinGW.org project
+ * Copyright 2008, 2012-2014 MinGW.org Project
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-
/*
+ * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
+ *
+ *
* Provides a generic implementation for the `lround()', `lroundf()',
* `lroundl()', `llround()', `llroundf()' and `llroundl()' functions;
* compile with `-D FUNCTION=name', with `name' set to each of these
* six in turn, to create separate object files for each of the six
* functions.
+ *
*/
#ifndef FUNCTION
/*
+++ /dev/null
-/**
- * @file lroundf.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION lroundf
-#include "lround_generic.c"
+++ /dev/null
-/**
- * @file lroundl.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION lroundl
-#include "lround_generic.c"
+++ /dev/null
-/**
- * @file round.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION round
-#include "round_generic.c"
/**
* @file round_generic.c
- * Copyright 2012, 2013 MinGW.org project
+ * Copyright 2008, 2012-2014 MinGW.org Project
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-
/*
+ * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
+ *
+ *
* Provides a generic implementation for the `round()', `roundf()'
* and `roundl()' functions; compile with `-D FUNCTION=name', with
* `name' set to each of these three in turn, to create separate
* object files for each of the three functions.
+ *
*/
#ifndef FUNCTION
/*
+++ /dev/null
-/**
- * @file roundf.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION roundf
-#include "round_generic.c"
+++ /dev/null
-/**
- * @file roundl.c
- * Copyright 2012, 2013 MinGW.org project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#define FUNCTION roundl
-#include "round_generic.c"