[En-Nut-Discussion] strtok_r for ImageCraft compiler

Greg Barron gbarron at daintree.net
Tue Jul 27 01:29:53 CEST 2004


Hi.

This is not backwards compatible of course. If you write your own wrapper
function you would only need to have the conditionals in one place. If
speed/code size is a concern for you, you could #define this. 

Regards,
--
Greg
-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Oliver Schulz
Sent: Tuesday, 27 July 2004 6:26 AM
To: 'Ethernut User Chat (English)'
Subject: [En-Nut-Discussion] strtok_r for ImageCraft compiler

Hi all,

one question for the community.
Avr-libc supplies the function strtok_r with the following prototype

char *strtok_r(char *, const char *, char **);

which follows the most implementations that I found on the net.
The ImageCraft compiler doesn't have this function, so Nut/OS supplies the
function for ICC, but with this prototype

char * strtok_r(  char ** pp_str, const char * p_delim );

These two versions are obviously not compatible.
To get out of this dilemma and avoid conditional compilations for the two
supported compilers, I suggest to change the function for ICC according to
the avr-libc one.

Of course some of the written code has to be adjusted, but I think that not
the big thing to get rid of this little mess.

Now waiting for your comments!

Regards,
Oliver.

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion





More information about the En-Nut-Discussion mailing list