[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: branch-1_4 - platform recognition macro
From: |
Eric Blake |
Subject: |
Re: branch-1_4 - platform recognition macro |
Date: |
Tue, 11 Jul 2006 06:16:51 -0600 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Andreas Büning on 7/7/2006 12:44 PM:
>
> Done. platform_ma fails because neither __unix__ nor __windows__ is defined.
> syscmd() in 79.sysval starts an interactive (!) shell so I had to enter "exit"
> to continue with the tests. This behaviour of system("") is documented.
> I'm sorry to hesitate you over and over again with the same topic. :-(
That's okay, because now we can get through the entire testsuite without
failures on OS/2 (at least, I sure hope so!). Thanks for your persistence:
2006-07-11 Eric Blake <address@hidden>
* src/m4.h (OS2): New platform macro.
* src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
platform macro.
* doc/m4.texinfo (Platform macros): Document it.
(Sysval): Remove non-portable test of system("").
* NEWS: Document this change.
Reported by Andreas Buening.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEs5ay84KuGfSFAYARApJhAJ9IszE+gvLGeGObqpOQW4ZHFDyE+QCgnOeQ
55UR+Vyw+LyhcQDsKtoJ3AE=
=tHx9
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/m4/m4/NEWS,v
retrieving revision 1.1.1.1.2.31
diff -u -p -r1.1.1.1.2.31 NEWS
--- NEWS 10 Jul 2006 01:44:10 -0000 1.1.1.1.2.31
+++ NEWS 11 Jul 2006 12:14:50 -0000
@@ -25,8 +25,8 @@ Version 1.4.5 - ?? 2006, by ??? (CVS ve
functions, format is no longer subject to a buffer overflow that
permitted arbitrary code execution.
* On Windows builds, the macro __windows__ is provided instead of
- __unix__. This allows input files to determine when syscmd might behave
- differently.
+ __unix__. Likewise, on OS/2 builds, the macro __os2__ is provided. This
+ allows input files to determine when syscmd might behave differently.
* Fix bug in 1.4.3 patch to use \n line-endings that did not work for
cygwin.
* When given the empty string or 0, undivert is now documented as a no-op
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.34
diff -u -p -r1.1.1.1.2.34 m4.texinfo
--- doc/m4.texinfo 10 Jul 2006 01:44:10 -0000 1.1.1.1.2.34
+++ doc/m4.texinfo 11 Jul 2006 12:14:51 -0000
@@ -3375,6 +3375,8 @@ their existence will confirm platform de
@comment ignore
@example
__gnu__
+__os2__
+os2
__unix__
unix
__windows__
@@ -3404,6 +3406,11 @@ On native Windows systems, GNU @code{m4}
will define the macro @code{__windows__}, otherwise the macro
@code{windows}. Both will expand to the empty string.
address@hidden os2
+On OS/2 systems, GNU @code{m4} without the @samp{-G} option will define
+the macro @code{__os2__}, otherwise the macro @code{os2}. Both will
+expand to the empty string.
+
If GNU @code{m4} does not provide a platform macro for your system,
please report that as a bug.
@@ -3414,6 +3421,8 @@ ifdef(`__unix__', `define(`provided', in
@result{}
ifdef(`__windows__', `define(`provided', incr(provided))')
@result{}
+ifdef(`__os2__', `define(`provided', incr(provided))')
address@hidden
provided
@result{}1
@end example
@@ -3517,10 +3526,6 @@ syscmd(`false')
@result{}
ifelse(sysval, `0', `zero', `non-zero')
@result{}non-zero
-syscmd()
address@hidden
-sysval
address@hidden
syscmd(`exit 2')
@result{}
sysval
@@ -3533,10 +3538,6 @@ esyscmd(`false')
@result{}
ifelse(sysval, `0', `zero', `non-zero')
@result{}non-zero
-esyscmd()
address@hidden
-sysval
address@hidden
esyscmd(`exit 2')
@result{}
sysval
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.19
diff -u -p -r1.1.1.1.2.19 builtin.c
--- src/builtin.c 10 Jul 2006 01:44:10 -0000 1.1.1.1.2.19
+++ src/builtin.c 11 Jul 2006 12:14:51 -0000
@@ -156,6 +156,8 @@ predefined_tab[] =
{ "unix", "__unix__", "" },
#elif W32_NATIVE
{ "windows", "__windows__", "" },
+#elif OS2
+ { "os2", "__os2__", "" },
#else
# warning Platform macro not provided
#endif
Index: src/m4.h
===================================================================
RCS file: /sources/m4/m4/src/m4.h,v
retrieving revision 1.1.1.1.2.15
diff -u -p -r1.1.1.1.2.15 m4.h
--- src/m4.h 7 Jul 2006 20:20:38 -0000 1.1.1.1.2.15
+++ src/m4.h 11 Jul 2006 12:14:51 -0000
@@ -36,6 +36,11 @@
# define W32_NATIVE 1
#endif
+/* Canonicalize OS/2 recognition macro. */
+#ifdef __EMX__
+# define OS2 1
+#endif
+
/* FIXME - we no longer need this ansi2knr hack. */
#define _(Args) Args