Open flwyd opened 1 day ago
for mac and freebsd (and certainly other bsd), fpurge()
is in stdio.h:
linux and solaris : __fpurge()
is in stdio_ext.h
https://docs.oracle.com/cd/E88353_01/html/E37843/u--fpurge-3c.html
nothing like fpurge()
on windows afaics.
I'll fix it this evening or tomorrow, in a cross platform way
I took a peek, and surprise! We already did that. It should already be cross-compatible here. All of these lines are inside of #ifdef _WIN32. Curiously, the function that uses it doesn't have a non-WIN32 branch https://github.com/luser-dr00g/xpost/blob/master/src/lib/xpost_file.c#L197. So, if it's compiling for MacOs, why is _WIN32 defined?
This is all a bit silly because fpurge() isn't used anywhere internally, it's all to support the obscure postscript operator 'resetfile'.
@luser-dr00g the problem is the code below in xpost_file.c:
#ifndef _WIN32
# include <stdio_ext.h> /* __fpurge */
#endif
which is for linux and solaris (see my comment above). And anyway, mac and BSD have fpurge()
, not __fpurge()
I propose an xpost_fpurge()
in xpost_compat.h.
but is disk_purge()
even used btw ? I don't see it anywhere in the code
./autogen.sh && make
on macOS Monterey with the Xcode compiler fails with an error. It looks likestdio_ext.h
is a glibc and Solaris thing, but not present on Mac (or the BSD family tree generally, perhaps?).