public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* some simple patches
@ 2016-07-18  6:16 Trevor Saunders
  2016-07-25 15:39 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Trevor Saunders @ 2016-07-18  6:16 UTC (permalink / raw)
  To: cgen

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: some simple patches
  2016-07-18  6:16 some simple patches Trevor Saunders
@ 2016-07-25 15:39 ` Frank Ch. Eigler
  2016-07-25 18:47   ` Trevor Saunders
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2016-07-25 15:39 UTC (permalink / raw)
  To: Trevor Saunders; +Cc: cgen

Hi -

On Mon, Jul 18, 2016 at 02:24:19AM -0400, Trevor Saunders wrote:
> [...]
> I checked the resulting generated code for binutils-gdb.git builds fine
> with this.  Is it ok? can someone apply it for me please?

Merged the first two bits.  Not sure where the other
copyright-notice-related change comes in; I don't see the original
line in cvs, nor is that file modified by the other hunks.

- FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: some simple patches
  2016-07-25 15:39 ` Frank Ch. Eigler
@ 2016-07-25 18:47   ` Trevor Saunders
  0 siblings, 0 replies; 3+ messages in thread
From: Trevor Saunders @ 2016-07-25 18:47 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

On Mon, Jul 25, 2016 at 11:39:12AM -0400, Frank Ch. Eigler wrote:
> Hi -
> 
> On Mon, Jul 18, 2016 at 02:24:19AM -0400, Trevor Saunders wrote:
> > [...]
> > I checked the resulting generated code for binutils-gdb.git builds fine
> > with this.  Is it ok? can someone apply it for me please?
> 
> Merged the first two bits.  Not sure where the other
> copyright-notice-related change comes in; I don't see the original
> line in cvs, nor is that file modified by the other hunks.

hmm, that change makes cgen not change the copyright dates for the
checked in files in binutils-gdb.git.  However maybe that file is
generated? I don't know cvs well enough to notice that.

Trev

> 
> - FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-25 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18  6:16 some simple patches Trevor Saunders
2016-07-25 15:39 ` Frank Ch. Eigler
2016-07-25 18:47   ` Trevor Saunders

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).