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

Re: [MiNT] isblank() and -D_GNU_SOURCE



J. F. Lemaire a écrit :
Currently, to use the isblank() function one must compile with "-D_GNU_SOURCE". However, isblank() is now part of C99 (it conforms to POSIX.1-2001 and C99 7.4.1.3 according to the man page). Shouldn't the mintlib be updated to reflect that change?

From Cygwin /usr/include/ctype.h (Newlib)
#ifndef __STRICT_ANSI__
int __cdecl isblank(int);
...

From Debian Etch /usr/include/ctype.h (glibc)
/* ISO C99 introduced one new function.  */
#ifdef  __USE_ISOC99
...
__exctype (isblank);


This is once again the same problem.
- MiNTLib is a UNIX API emulation layer, it does this very well by delegating to the FreeMiNT kernel or plain TOS.
- MiNTLib is also a C standard library, unfortunately it is outdated.

These two points are really two different things. The C standard library use UNIX calls to implement file I/O, for example. The UNIX emulation layer can use the services of the standard library, such as strcmp().

So it would be good to split the current MiNTLib into two parts.

For information, this is exactly the method used by Newlib to be as portable as possible. The Newlib package contains actually 2 libraries :
- libc.a, the C standard library, requiring about 10 UNIX system calls
- "libgloss", a generic name for the library implementing the UNIX system calls, which is renamed for the various systems. For example, it could be libmint.a for us.

I don't know how much code of the MiNTLib is really related to MiNT. If it is not so big, putting it into the Newlib's libgloss would give us immediately an up to date C library with full MiNT support (with isblank support when appropriate !). With that, there is absolutely no reason to have problems for porting most GNU/Linux software, except if they use advanced kernel features, such as memory mapped files, fork (!) for parallel execution, etc... Most software don't do that.

We should definitely investigate this seriously.

--
Vincent Rivière