avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Re: [avr-gcc-list] 32-bit type in -mint8 mode


From: Svein E. Seldal
Subject: [avr-libc-dev] Re: [avr-gcc-list] 32-bit type in -mint8 mode
Date: Fri, 04 Jun 2004 15:37:45 +0200
User-agent: Mozilla Thunderbird 0.6 (X11/20040528)

Joerg Wunsch wrote:

Does the attached patch look reasonable?

Yes it does, except for a little typo. I've attached a new patch. You missed a "long" here - you need two:

   #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5)
   typedef long long int32_t;
   typedef unsigned long long uint32_t;
   #else

However there is an ongoing discussion whether to name the next GCC version 3.5 or 4.0. Thus we might have to change this patch again later.

On a second thought, it can maybe be wise to keep the code there, because GCC CVS HEAD is versioned 3.5.0, so it will work with both today's development versions and tomorrow's GCC release X.Y.


Svein
? doc/examples/Makefile.in
? libc/stdio/Makefile.in
Index: ChangeLog
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/ChangeLog,v
retrieving revision 1.372
diff -u -r1.372 ChangeLog
--- ChangeLog   25 May 2004 08:40:02 -0000      1.372
+++ ChangeLog   4 Jun 2004 13:32:23 -0000
@@ -1,3 +1,8 @@
+2004-05-28  Joerg Wunsch <address@hidden>
+
+       * include/inttypes.h: avr-gcc >= 3.5 will be able to
+       provide [u]int32_t when -mint8 is in effect.
+
 2004-05-25  Joerg Wunsch <address@hidden>
 
        * doc/examples/demo.c: Update for ATmega8
Index: include/inttypes.h
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/include/inttypes.h,v
retrieving revision 1.6
diff -u -r1.6 inttypes.h
--- include/inttypes.h  18 Sep 2003 18:36:17 -0000      1.6
+++ include/inttypes.h  4 Jun 2004 13:32:23 -0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, Marek Michalkiewicz
+/* Copyright (c) 2002,2004 Marek Michalkiewicz
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -44,14 +44,7 @@
     over rolling your own typedefs.
 
     \note If avr-gcc's \c -mint8 option is used, no 32-bit types will be
-    available.
-
-    \todo There is a pending patch that may go into gcc to change the
-    behaviour of the -mint8 option.  The current (2003-09-17) situation for
-    -mint8 is sizeof(int) == 1, sizeof(long) == 2 and sizeof(long long) == 8.
-    Note the absence of a 4-byte, 32-bit type.  The patch proposes to change
-    sozeof(long long) to be 4 bytes (32 bits).  When and if the patch is
-    included in gcc, we will need to change avr-libc accordingly.  */
+    available for all versions of GCC below 3.5.  */
 
 #if __INT_MAX__ == 127
 # define __USING_MINT8 1
@@ -76,6 +69,14 @@
 typedef long int16_t;
 typedef unsigned long uint16_t;
 
+#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5)
+typedef long long int32_t;
+typedef unsigned long long uint32_t;
+#else
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+#endif
+
 #else /* no -mint8 */
 
 /address@hidden/
@@ -110,8 +111,6 @@
 
 typedef unsigned long uint32_t;
 
-#endif
-
 /address@hidden/
 
 /** \name 64-bit types. */
@@ -127,6 +126,8 @@
     64-bit unsigned type. */
 
 typedef unsigned long long uint64_t;
+
+#endif
 
 /address@hidden/
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]