This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[rfa] `struct _bfd' -> `struct bfd'
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 24 Feb 2003 01:48:45 -0500
- Subject: [rfa] `struct _bfd' -> `struct bfd'
Hello,
The attached renames the BFD object to `struct bfd' from `struct _bfd'.
To ensure backward compatibility with existing code it also #defines
_bfd -> bfd.
Having `struct bfd' available will, I think, legitimize its use as an
opaque declaration vis:
struct bfd;
void func (struct bfd *abfd);
Also, as far as I know, symbols with a leading `_' live in the system
name space.
Ok to commit?
Andrew
2003-02-24 Andrew Cagney <cagney at redhat dot com>
* bfd.c (struct bfd): Rename "struct _bfd".
* bfd-in.h: Update copyright.
(struct bfd): Rename "struct _bfd".
(_bfd): Define for backward compatibility.
* bfd-in2.h: Regenerate.
Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.55
diff -u -r1.55 bfd-in.h
--- bfd-in.h 8 Dec 2002 03:34:38 -0000 1.55
+++ bfd-in.h 24 Feb 2003 06:34:52 -0000
@@ -1,7 +1,8 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -68,7 +69,10 @@
#endif
/* Forward declaration. */
-typedef struct _bfd bfd;
+typedef struct bfd bfd;
+/* For backward compatibility. Keep code that was using "struct
+ _bfd" working. */
+#define _bfd bfd
/* Boolean type used in bfd. Too many systems define their own
versions of "boolean" for us to safely typedef a "boolean" of
Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.46
diff -u -r1.46 bfd.c
--- bfd.c 14 Feb 2003 11:16:09 -0000 1.46
+++ bfd.c 24 Feb 2003 06:35:21 -0000
@@ -34,7 +34,7 @@
CODE_FRAGMENT
.
-.struct _bfd
+.struct bfd
.{
. {* A unique identifier of the BFD *}
. unsigned int id;