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] 64 bit formatting directives on MingW32


MingW32 hosted compilers use the Win32 runtime libraries for printing
and require %I64d to print 64 bit integers.

Earl

2003-07-14 Earl Chew <earl_chew@agilent.com>

* hwint.h: Add 64 bit formatting directives for MINGW32

Index: hwint.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/hwint.h,v
retrieving revision 1.17
diff -c -r1.17 hwint.h
*** hwint.h	25 Jun 2003 19:33:08 -0000	1.17
--- hwint.h	14 Jul 2003 20:24:04 -0000
***************
*** 73,78 ****
--- 73,82 ----
  # else
  #  define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
  # endif
+ #elif defined(__MINGW32__)
+ # define HOST_WIDE_INT_PRINT "I64"
+ # define HOST_WIDE_INT_PRINT_C "LL"
+ # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%I64x%016I64x"
  #else
  # define HOST_WIDE_INT_PRINT "ll"
  # define HOST_WIDE_INT_PRINT_C "LL"
***************
*** 109,119 ****
      #error "This line should be impossible to reach"
  #  endif
  # endif
! # define HOST_WIDEST_INT_PRINT_DEC	      "%lld"
! # define HOST_WIDEST_INT_PRINT_DEC_C	      "%lldLL"
! # define HOST_WIDEST_INT_PRINT_UNSIGNED	      "%llu"
! # define HOST_WIDEST_INT_PRINT_HEX	      "0x%llx"
! # define HOST_WIDEST_INT_PRINT_DOUBLE_HEX     "0x%llx%016llx"
  #endif

#endif /* ! GCC_HWINT_H */
--- 113,129 ----
#error "This line should be impossible to reach"
# endif
# endif
! # ifdef __MINGW32__
! # define HOST_WIDEST_INT_PRINT "I64"
! # else
! # define HOST_WIDEST_INT_PRINT "ll"
! # endif
! # define HOST_WIDEST_INT_PRINT_DEC "%" HOST_WIDEST_INT_PRINT "d"
! # define HOST_WIDEST_INT_PRINT_DEC_C "%" HOST_WIDEST_INT_PRINT "dLL"
! # define HOST_WIDEST_INT_PRINT_UNSIGNED "%" HOST_WIDEST_INT_PRINT "u"
! # define HOST_WIDEST_INT_PRINT_HEX "0x%" HOST_WIDEST_INT_PRINT "x"
! # define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%" HOST_WIDEST_INT_PRINT "x" \
! "%016" HOST_WIDEST_INT_PRINT "x"
#endif


#endif /* ! GCC_HWINT_H */


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