I believe relying on __compar_fn_t in dlls/wineps/afm.c is a Linuxism recently added to dlls/wineps/afm.c (and only there), Ian.
Given that __compar_fn_t is only used in that single file and nowhere else, I'd suggest to simply use a typedef of your own instead of the non-portable __compar_fn_t. -- Could you please have a look?
Alexandre, in the mean-time please consider my patch below, which gets rid of the build failure at least.
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC -D__WINE__ -D_REENTRANT -I/usr/X11R6/include -o afm.o afm.c afm.c: In function `SortFontMetrics': afm.c:686: `__compar_fn_t' undeclared (first use in this function) afm.c:686: (Each undeclared identifier is reported only once afm.c:686: for each function it appears in.) afm.c:686: syntax error before `UnicodeGlyphByNameIndex' afm.c:698: syntax error before `UnicodeGlyphByNameIndex' afm.c:718: syntax error before `UnicodeGlyphByUV' afm.c:729: syntax error before `AFMMetricsByUV' afm.c:691: warning: `pug' might be used uninitialized in this function afm.c: At top level: afm.c:644: warning: `UnicodeGlyphByNameIndex' defined but not used afm.c:649: warning: `UnicodeGlyphByUV' defined but not used afm.c:654: warning: `AFMMetricsByUV' defined but not used gmake[2]: *** [afm.o] Error 1 gmake[2]: Leaving directory `/.amd_mnt/vexpert/files8/test/wine/dlls/wineps' gmake[1]: *** [wineps/libwineps.so] Error 2
Thanks, Gerald
Index: afm.c =================================================================== RCS file: /home/wine/wine/dlls/wineps/afm.c,v retrieving revision 1.13 diff -u -3 -p -r1.13 afm.c --- afm.c 2001/05/09 17:11:59 1.13 +++ afm.c 2001/05/11 10:58:58 @@ -683,7 +683,7 @@ static BOOL SortFontMetrics()
qsort(aglCopy, PSDRV_AdobeGlyphList.size, sizeof(UNICODEGLYPH), - (__compar_fn_t)UnicodeGlyphByNameIndex); + UnicodeGlyphByNameIndex); }
for (i = 0; i < afm->NumofMetrics; ++i) @@ -695,7 +695,7 @@ static BOOL SortFontMetrics()
pug = bsearch(&ug, aglCopy, PSDRV_AdobeGlyphList.size, sizeof(UNICODEGLYPH), - (__compar_fn_t)UnicodeGlyphByNameIndex); + UnicodeGlyphByNameIndex); if (pug == NULL) { WARN("Glyph '%s' in font '%s' does not have a UV\n", @@ -715,7 +715,7 @@ static BOOL SortFontMetrics()
/* typecast avoids compiler warning */ qsort((void *)(afm->Encoding->glyphs), afm->Encoding->size, - sizeof(UNICODEGLYPH), (__compar_fn_t)UnicodeGlyphByUV); + sizeof(UNICODEGLYPH), UnicodeGlyphByUV);
for (i = 0; i < afm->Encoding->size; ++i) if (afm->Encoding->glyphs[i].UV >= 0) @@ -726,7 +726,7 @@ static BOOL SortFontMetrics() }
qsort(afm->Metrics, afm->NumofMetrics, sizeof(AFMMETRICS), - (__compar_fn_t)AFMMetricsByUV); + AFMMetricsByUV);
for (i = 0; i < afm->NumofMetrics; ++i) if (afm->Metrics[i].UV >= 0)
On Fri, May 11, 2001 at 01:09:27PM +0200, Gerald Pfeifer wrote:
I believe relying on __compar_fn_t in dlls/wineps/afm.c is a Linuxism recently added to dlls/wineps/afm.c (and only there), Ian.
I have experienced the same problem with NetBSD.
Given that __compar_fn_t is only used in that single file and nowhere else, I'd suggest to simply use a typedef of your own instead of the non-portable __compar_fn_t. -- Could you please have a look?
I agree.
Jun-Young
Gerald Pfeifer wrote:
I believe relying on __compar_fn_t in dlls/wineps/afm.c is a Linuxism recently added to dlls/wineps/afm.c (and only there), Ian.
My apologies. The GNU version of stdlib.h includes the following snippet, which led be to believe that __compar_fn_t was standard:
/* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (__const void *, __const void *);
# ifdef __USE_GNU typedef __compar_fn_t comparison_fn_t; # endif #endif
(Trying to show that I'm not a complete idiot!) I have sent a patch in to replace the use of __compar_fn_t with a typedef.
Thanks for catching that.