Re: problem with glib 1.3.7 on darwin



On Mon, 10 Sep 2001, Max Horn wrote:

> [I am not sure if this is the right list for this, I couldn't find 
> one better suited, but please point me to a better place than this if 
> there is one! thanks]
> 
> 
> Together with Finlay Doobie, I am looking into getting a native 
> backend for gtk+ on MacOS X (darwin, aqua) working. TO this end I 
> wanted to get latest gtk+ CVS "working" (meaning I added stuff to the 
> configure scripts etc etc.). However, that requires glib 1.3.7. Fine, 
> so I got that. (That requires again pkgconfig, I got 0.8.0, which has 
> its own copy of glib-1.2.8, sigh, but that is another story).
> 
> Now I can compile glib 1.3.7 fine, however, running make check gives 
> an error in tests/strfunc-test.c, and to me it seems this is a 
> problem with that file not darwin, but please correct me. What fails? 
> In line 329ff it complains about isalnum, isalpha etc. missing. The 
> code look like this:
> 
>    #define TEST_IS(name) test_is_function (#name, test_##name, name, 
> g_unichar_##name)
>    isalnum('a');
>    TEST_IS (isalnum);
>    TEST_IS (isalpha);
>    ...
> 
> The reason is simple: darwin's ctype.h #define's those as macros:
> #define isalnum(c)      __istype((c), (_A|_D))
> ...
> 
> But the C preprocessor will not expand isalnum ! It would be wrong 
> for it in fact. GLIB assumes that those functions are real function, 
> but in real, on many many implementations they are macros.
> 
> 
> I hope this will be fixed eventually. Please correct me if I am 
> mistaken in any of my assertions.

Well. The fix is to do the same that is currently being done with the 
g_ascii_isalnum() etc. macros. I.e. wrap the isalnum() call in a function.

But this is just a test, so it isn't of critical importance right now.

/ Alex






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