[En-Nut-Discussion] Patch for SuSE 10.0 and gcc402

Matthias Ringwald mringwal at inf.ethz.ch
Fri Nov 25 12:05:56 CET 2005


On 25.11.2005, at 00:19, Torben Mikael Hansen wrote:

> Harald,
>>> b) <avr/signal.h> obsolete -> commenting it out from include/arch/ 
>>> avr/gcc.h
>>
>> This is related to avr-libc, not GCC. May be we can use
>> an ifdef, similar to the twi.h patch?
>>
> How about this?
> http://linhard.dk/ethernut/libcv104.patch

this would be..
> +#if __AVR_LIBC_VERSION__ < 10400UL
> +  #include <avr/signal.h>
> +#endif

wow. either the avr/version.h is new or I have been kind of blind  
some time ago.

checking avr/version.h

/* $Id: version.h.in,v 1.1 2005/09/12 20:18:12 joerg_wunsch Exp $ */

/** \defgroup avr_version <avr/version.h>: avr-libc version macros
     \code #include <avr/version.h> \endcode

     This header file defines macros that contain version numbers and
     strings describing the current version of avr-libc.

     The version number itself basically consists of three pieces that
     are separated by a dot: the major number, the minor number, and
     the revision number.  For development versions (which use an odd
     minor number), the string representation additionally gets the
     date code (YYYYMMDD) appended.

     This file will also be included by \c <avr/io.h>.  That way,
     portable tests can be implemented using \c <avr/io.h> that can be
     used in code that wants to remain backwards-compatible to library
     versions prior to the date when the library version API had been
     added, as referenced but undefined C preprocessor macros
     automatically evaluate to 0.
*/

so at least, it is new and just wasn't there when I was looking for  
something like it.


from this I get: don't include <avr/version.h> but include <avr/io.h>
as otherwise there's a missing include file for older versions.

with this version macro in place, all (new) checks for changed header  
files
should use it.

and I guess, the twi.h patch hack has to survive, as there
wasn't a version nr to test.

Torben, can you verifty, that your system compiles (without the avr/ 
version include):

--- nut/include/arch/avr/gcc.h	2005-11-24 23:47:43.000000000 +0100
+++ nut_wk/include/arch/avr/gcc.h	2005-11-24 23:42:58.000000000 +0100
@@ -53,7 +53,9 @@

  #include <avr/io.h>
  #include <avr/interrupt.h>
-#include <avr/signal.h>
+#if __AVR_LIBC_VERSION__ < 10400UL
+  #include <avr/signal.h>
+#endif
  #include <avr/eeprom.h>
  #include <avr/pgmspace.h>
  #include <avr/sleep.h>


matthias










More information about the En-Nut-Discussion mailing list