public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [rfa] `struct _bfd' -> `struct bfd'
@ 2003-02-24  6:49 Andrew Cagney
  2003-02-25  3:09 ` Andrew Cagney
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andrew Cagney @ 2003-02-24  6:49 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 413 bytes --]

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

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1671 bytes --]

2003-02-24  Andrew Cagney  <cagney@redhat.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;

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

end of thread, other threads:[~2003-05-04 15:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-24  6:49 [rfa] `struct _bfd' -> `struct bfd' Andrew Cagney
2003-02-25  3:09 ` Andrew Cagney
2003-02-25  7:53   ` Ian Lance Taylor
2003-02-26 20:41 ` Hans-Peter Nilsson
2003-02-26 21:18   ` Andreas Schwab
2003-02-27  1:17 ` Alan Modra
2003-02-27  2:12   ` Andrew Cagney
2003-02-27  2:19     ` Alan Modra
2003-02-28 23:59       ` Alan Modra
2003-05-04 14:21 ` Andrew Cagney
2003-05-04 15:23   ` Doug Evans
2003-05-04 15:37     ` Andrew Cagney

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