• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

Revisão63e9ed5552c5c99df5d049544f9bda9e5e0d84df (tree)
Hora2014-01-28 07:13:35
AutorKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Mensagem de Log

Re-establish pattern rules for %_generic.c; (cf. issue #2175)

--HG--
rename : src/libcrt/math/asinh.c => src/libcrt/math/asinh_generic.c

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
1+2014-01-27 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Re-establish pattern rules for %_generic.c; (cf. issue #2175)
4+
5+ * src/libcrt/math/round.c: Delete it; this kludgey stub isn't needed.
6+ * src/libcrt/math/roundf.c src/libcrt/math/roundl.c: Likewise.
7+ * src/libcrt/math/lround.c src/libcrt/math/lroundf.c: Likewise.
8+ * src/libcrt/math/lroundl.c: Likewise.
9+
10+ * src/libcrt/math/asinh.c: Rename to...
11+ * src/libcrt/math/asinh_generic.c: ...this; compliance with the
12+ math_generic.c naming convention is imperative.
13+
14+ * src/libcrt/math/round_generic.c: Reinstate author attribution.
15+ * src/libcrt/math/lround_generic.c: Likewise.
16+
17+ * Makefile.in (math_SOURCES): Remove references to deleted files; add
18+ references to corresponding %_generic.c sources, in their place.
19+ (libmingwex_a_OBJECTS): Filter %_generic references, to generate the
20+ corresponding %.o, %f.o, and %l.o references; append llround%.o set.
21+ Adjust pattern rules to build each set of three; add a static pattern
22+ rule, to accommodate special requirements of the llround% set.
23+
124 2014-01-22 Keith Marshall <keithmarshall@users.sourceforge.net>
225
326 Reinstate complex math functions; (cf. issue #2174)
--- a/Makefile.in
+++ b/Makefile.in
@@ -364,7 +364,7 @@ math_SOURCES := \
364364 $(SRCDIR)/acoshl.c \
365365 $(SRCDIR)/acosl.c \
366366 $(SRCDIR)/asinf.c \
367- $(SRCDIR)/asinh.c \
367+ $(SRCDIR)/asinh_generic.c \
368368 $(SRCDIR)/asinl.c \
369369 $(SRCDIR)/atan2f.c \
370370 $(SRCDIR)/atan2l.c \
@@ -454,9 +454,7 @@ math_SOURCES := \
454454 $(SRCDIR)/lrint.c \
455455 $(SRCDIR)/lrintf.c \
456456 $(SRCDIR)/lrintl.c \
457- $(SRCDIR)/lround.c \
458- $(SRCDIR)/lroundl.c \
459- $(SRCDIR)/lroundf.c \
457+ $(SRCDIR)/lround_generic.c \
460458 $(SRCDIR)/modff.c \
461459 $(SRCDIR)/modfl.c \
462460 $(SRCDIR)/nearbyint.S \
@@ -481,9 +479,7 @@ math_SOURCES := \
481479 $(SRCDIR)/rint.c \
482480 $(SRCDIR)/rintf.c \
483481 $(SRCDIR)/rintl.c \
484- $(SRCDIR)/round.c \
485- $(SRCDIR)/roundf.c \
486- $(SRCDIR)/roundl.c \
482+ $(SRCDIR)/round_generic.c \
487483 $(MSRCDIR)/s_erf.c \
488484 $(SRCDIR)/scalbn.S \
489485 $(SRCDIR)/scalbnf.S \
@@ -620,11 +616,13 @@ libmingwex_a_SOURCES := \
620616 $(wchar_SOURCES) \
621617 $(wctype_SOURCES)
622618 libmingwex_a_OBJECTS := $(libmingwex_a_SOURCES:.c=.o)
623-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o)
624-
625-SRCDIR := src/libcrt/math
626-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhl.o
627-libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS) $(SRCDIR)/asinhf.o
619+libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o) \
620+ src/libcrt/math/llround_generic.o
621+libmingwex_a_generic_objects := $(filter %_generic.o,$(libmingwex_a_OBJECTS))
622+libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:%_generic.o=%.o) \
623+ $(libmingwex_a_generic_objects:%_generic.o=%f.o) \
624+ $(libmingwex_a_generic_objects:%_generic.o=%l.o)
625+libmingwex_a_OBJECTS := $(sort $(libmingwex_a_OBJECTS))
628626
629627 SRCDIR := misc/src/libdinput
630628 libdinput_a_SOURCES := \
@@ -755,14 +753,30 @@ lib%.a: src/lib%/%.o
755753 $(MKDIR_P) $(@D)
756754 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
757755
756+# For the math sources, we support the convention that a single
757+# quux_generic.c source file will produce three objects: quux.o,
758+# quuxf.o, and quuxl.o; since a change in the common source file
759+# will require all three objects to be recompiled, we may handle
760+# this with a single, multiple target, pattern rule.
761+#
758762 SRCDIR := src/libcrt/math
759-$(SRCDIR)/%f.o: $(SRCDIR)/%.c
763+$(SRCDIR)/%.o $(SRCDIR)/%f.o $(SRCDIR)/%l.o: $(SRCDIR)/%_generic.c
760764 $(MKDIR_P) $(@D)
761- $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
762-
763-$(SRCDIR)/%l.o: $(SRCDIR)/%.c
765+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*.o $<
766+ $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $<
767+ $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $<
768+
769+# The llround.o, llroundf.o, and llroundl.o variants are a special
770+# case of the preceding rule; (the source is lround_generic.c rather
771+# than llround_generic.c). We can handle this using the following
772+# static pattern rule, (again, compiling all three objects).
773+#
774+$(SRCDIR)/llroundf.o $(SRCDIR)/llroundl.o: $(SRCDIR)/llround.o
775+$(SRCDIR)/llround.o: $(SRCDIR)/%.o: $(SRCDIR)/lround_generic.c
764776 $(MKDIR_P) $(@D)
765- $(CC) -c -D FUNCTION=$(@F:.o=) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
777+ $(CC) -c -D FUNCTION=$* $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
778+ $(CC) -c -D FUNCTION=$*f $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*f.o $<
779+ $(CC) -c -D FUNCTION=$*l $(CPPFLAGS) $(ALL_CFLAGS) -o $(@D)/$*l.o $<
766780
767781 SRCDIR := src/libcrt/crt
768782 $(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o:
--- a/src/libcrt/math/asinh.c
+++ b/src/libcrt/math/asinh_generic.c
@@ -1,5 +1,5 @@
11 /**
2- * @file asinh.c
2+ * @file asinh_generic.c
33 * Copyright 2012, 2013 MinGW.org project
44 *
55 * Permission is hereby granted, free of charge, to any person obtaining a
--- a/src/libcrt/math/lround.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file lround.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION lround
25-#include "lround_generic.c"
--- a/src/libcrt/math/lround_generic.c
+++ b/src/libcrt/math/lround_generic.c
@@ -1,6 +1,6 @@
11 /**
22 * @file lround_generic.c
3- * Copyright 2012, 2013 MinGW.org project
3+ * Copyright 2008, 2012-2014 MinGW.org Project
44 *
55 * Permission is hereby granted, free of charge, to any person obtaining a
66 * copy of this software and associated documentation files (the "Software"),
@@ -21,13 +21,16 @@
2121 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2222 * DEALINGS IN THE SOFTWARE.
2323 */
24-
2524 /*
25+ * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
26+ *
27+ *
2628 * Provides a generic implementation for the `lround()', `lroundf()',
2729 * `lroundl()', `llround()', `llroundf()' and `llroundl()' functions;
2830 * compile with `-D FUNCTION=name', with `name' set to each of these
2931 * six in turn, to create separate object files for each of the six
3032 * functions.
33+ *
3134 */
3235 #ifndef FUNCTION
3336 /*
--- a/src/libcrt/math/lroundf.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file lroundf.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION lroundf
25-#include "lround_generic.c"
--- a/src/libcrt/math/lroundl.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file lroundl.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION lroundl
25-#include "lround_generic.c"
--- a/src/libcrt/math/round.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file round.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION round
25-#include "round_generic.c"
--- a/src/libcrt/math/round_generic.c
+++ b/src/libcrt/math/round_generic.c
@@ -1,6 +1,6 @@
11 /**
22 * @file round_generic.c
3- * Copyright 2012, 2013 MinGW.org project
3+ * Copyright 2008, 2012-2014 MinGW.org Project
44 *
55 * Permission is hereby granted, free of charge, to any person obtaining a
66 * copy of this software and associated documentation files (the "Software"),
@@ -21,12 +21,15 @@
2121 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2222 * DEALINGS IN THE SOFTWARE.
2323 */
24-
2524 /*
25+ * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
26+ *
27+ *
2628 * Provides a generic implementation for the `round()', `roundf()'
2729 * and `roundl()' functions; compile with `-D FUNCTION=name', with
2830 * `name' set to each of these three in turn, to create separate
2931 * object files for each of the three functions.
32+ *
3033 */
3134 #ifndef FUNCTION
3235 /*
--- a/src/libcrt/math/roundf.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file roundf.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION roundf
25-#include "round_generic.c"
--- a/src/libcrt/math/roundl.c
+++ /dev/null
@@ -1,25 +0,0 @@
1-/**
2- * @file roundl.c
3- * Copyright 2012, 2013 MinGW.org project
4- *
5- * Permission is hereby granted, free of charge, to any person obtaining a
6- * copy of this software and associated documentation files (the "Software"),
7- * to deal in the Software without restriction, including without limitation
8- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9- * and/or sell copies of the Software, and to permit persons to whom the
10- * Software is furnished to do so, subject to the following conditions:
11- *
12- * The above copyright notice and this permission notice (including the next
13- * paragraph) shall be included in all copies or substantial portions of the
14- * Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22- * DEALINGS IN THE SOFTWARE.
23- */
24-#define FUNCTION roundl
25-#include "round_generic.c"