This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH Fix libgfortran itoa conflict on MinGW


libgfortran.h contains a macro:
#define itoa prefix(itoa)

This conflicts with the MinGW system headers, which provide an itoa in
<stdlib.h>.  A simple fix is just to move the system headers before the
macro definition.

Tested on i686-pc-mingw32.

I have a copyright assignment, but no CVS write access.

2004-09-15  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* intrinsics/abort.c ("libgfortran.h"): Move.
	* intrinsics/date_and_time.c ("libgfortran.h"): Same.
	* intrinsics/write.c ("libgfortran.h"): Same.

Index: gcc/libgfortran/intrinsics/abort.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/intrinsics/abort.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 abort.c
*** gcc/libgfortran/intrinsics/abort.c	30 May 2004 09:53:09 -0000	1.3
--- gcc/libgfortran/intrinsics/abort.c	15 Sep 2004 19:16:55 -0000
*************** License along with libgfor; see the file
*** 18,25 ****
  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */

- #include "libgfortran.h"
  #include <stdlib.h>


  void prefix(abort) (void);
--- 18,25 ----
  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */

  #include <stdlib.h>
+ #include "libgfortran.h"


  void prefix(abort) (void);
Index: gcc/libgfortran/intrinsics/date_and_time.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/intrinsics/date_and_time.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 date_and_time.c
*** gcc/libgfortran/intrinsics/date_and_time.c	12 Jun 2004 17:34:47
-0000	1.1
--- gcc/libgfortran/intrinsics/date_and_time.c	15 Sep 2004 19:16:56 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 23,32 ****
  #include <sys/types.h>
  #include <string.h>
  #include <assert.h>
- #include "libgfortran.h"
-
  #include <stdio.h>
  #include <stdlib.h>

  #undef HAVE_NO_DATE_TIME
  #if TIME_WITH_SYS_TIME
--- 23,31 ----
  #include <sys/types.h>
  #include <string.h>
  #include <assert.h>
  #include <stdio.h>
  #include <stdlib.h>
+ #include "libgfortran.h"

  #undef HAVE_NO_DATE_TIME
  #if TIME_WITH_SYS_TIME
Index: gcc/libgfortran/io/write.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.14
diff -c -3 -p -r1.14 write.c
*** gcc/libgfortran/io/write.c	6 Sep 2004 16:33:52 -0000	1.14
--- gcc/libgfortran/io/write.c	15 Sep 2004 19:16:59 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 21,30 ****
  #include "config.h"
  #include <string.h>
  #include <float.h>
- #include "libgfortran.h"
- #include "io.h"
  #include <stdio.h>
  #include <stdlib.h>


  #define star_fill(p, n) memset(p, '*', n)
--- 21,30 ----
  #include "config.h"
  #include <string.h>
  #include <float.h>
  #include <stdio.h>
  #include <stdlib.h>
+ #include "libgfortran.h"
+ #include "io.h"


  #define star_fill(p, n) memset(p, '*', n)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]