problem with glib 1.3.7 on darwin



[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.


Thanks,

Max
--
-----------------------------------------------
Max Horn
Software Developer

email: <mailto:max quendi de>
phone: (+49) 6151-494890




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