diff mbox

teach cgcc about OSX aka darwin

Message ID 20170529003757.3848-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck May 29, 2017, 12:37 a.m. UTC
cgcc knows about a few unix OSes but not yet about OSX/darwin.

Fix this by adding the two needed defines to cgcc's specs.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 cgcc | 3 +++
 1 file changed, 3 insertions(+)

Comments

Christopher Li June 5, 2017, 6:13 p.m. UTC | #1
On Sun, May 28, 2017 at 5:37 PM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> cgcc knows about a few unix OSes but not yet about OSX/darwin.
>
> Fix this by adding the two needed defines to cgcc's specs.

Looks fine to me.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cgcc b/cgcc
index c29fa587e..e4d4ff0bf 100755
--- a/cgcc
+++ b/cgcc
@@ -237,6 +237,9 @@  sub add_specs {
     } elsif ($spec eq 'openbsd') {
 	return &add_specs ('unix') .
 	    ' -D__OpenBSD__=1';
+    } elsif ($spec eq 'darwin') {
+	return
+	    ' -D__APPLE__=1 -D__MACH__=1';
     } elsif ($spec eq 'unix') {
 	return ' -Dunix=1 -D__unix=1 -D__unix__=1';
     } elsif ( $spec =~ /^cygwin/) {