From: Trevor Saunders <tbsaunde@tbsaunde.org>
To: cgen@sourceware.org
Subject: some simple patches
Date: Mon, 18 Jul 2016 06:16:00 -0000 [thread overview]
Message-ID: <20160718062419.GB8830@ball> (raw)
Hi,
Here's a patch to wrap generated headers in extern "C" so C++ code can
use them as well as C. While I was in the area I fixed the copy right
years in the template so that running cgen for binutils-gdb.git produces
the same thing as is checked in.
I checked the resulting generated code for binutils-gdb.git builds fine
with this. Is it ok? can someone apply it for me please?
Thanks!
Trev
Index: src/cgen/desc-cpu.scm
===================================================================
RCS file: /cvs/src/src/cgen/desc-cpu.scm,v
retrieving revision 1.33
diff -u -r1.33 desc-cpu.scm
--- src/cgen/desc-cpu.scm 13 Feb 2010 03:39:15 -0000 1.33
+++ src/cgen/desc-cpu.scm 18 Jul 2016 06:10:50 -0000
@@ -964,6 +964,10 @@
#ifndef @ARCH@_CPU_H
#define @ARCH@_CPU_H
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
"
/gen-hash-defines
; This is defined in arch.h. It's not defined here as there is yet to
@@ -1004,6 +1008,10 @@
""))
"
+ #ifdef __cplusplus
+ }
+ #endif
+
#endif /* @ARCH@_CPU_H */
"
)
Index: src/cgen/opc-itab.scm
===================================================================
RCS file: /cvs/src/src/cgen/opc-itab.scm,v
retrieving revision 1.19
diff -u -r1.19 opc-itab.scm
--- src/cgen/opc-itab.scm 14 Apr 2016 15:27:54 -0000 1.19
+++ src/cgen/opc-itab.scm 18 Jul 2016 06:10:50 -0000
@@ -701,6 +701,10 @@
#ifndef @ARCH@_OPC_H
#define @ARCH@_OPC_H
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
"
(lambda () (gen-extra-opc.h (opc-file-path) (current-arch-name)))
/gen-insn-enum
@@ -708,6 +712,10 @@
/gen-init-macros
"
+ #ifdef __cplusplus
+ }
+ #endif
+
#endif /* @ARCH@_OPC_H */
"
)
Index: src/cgen/utils.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils.scm,v
retrieving revision 1.38
diff -u -r1.38 utils.scm
--- src/cgen/utils.scm 2 Jan 2010 17:53:10 -0000 1.38
+++ src/cgen/utils.scm 18 Jul 2016 06:10:50 -0000
@@ -1310,7 +1310,7 @@
(cons "\
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996-2010 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 Free Software Foundation, Inc.
"
"\
This file is free software; you can redistribute it and/or modify
next reply other threads:[~2016-07-18 6:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 6:16 Trevor Saunders [this message]
2016-07-25 15:39 ` Frank Ch. Eigler
2016-07-25 18:47 ` Trevor Saunders
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160718062419.GB8830@ball \
--to=tbsaunde@tbsaunde.org \
--cc=cgen@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).