some simple patches

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

some simple patches

Trevor Saunders
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
Reply | Threaded
Open this post in threaded view
|

Re: some simple patches

Frank Ch. Eigler
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
Reply | Threaded
Open this post in threaded view
|

Re: some simple patches

Trevor Saunders
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