Hi there, I ran into a problem when using sfio and pth together on a debian system. On debian pth is compiled without sfio support. Which is fine with me, because I am supplying my own pth discipline support anyway.
Unfortunatly in this case pth.h declares Sfdisc_t to void* thereby not only *not* supporting sfio but actually preventing its use. This behaviour is a bit drastic. I propose the following patch (against the 1.4.0 source) to dump this behaviour, removing the declaration/definition of pth_sfiodisc when compiling without explicit sfio support. Dirk diff -u3 pth-1.4.0-orig/pth.h.in pth-1.4.0/pth.h.in --- pth-1.4.0-orig/pth.h.in Sat Mar 24 15:49:49 2001 +++ pth-1.4.0/pth.h.in Sun Dec 16 14:35:16 2001 @@ -370,8 +370,6 @@ /* Sfio extension support */ #if @PTH_EXT_SFIO@ #include <sfio.h> -#else -typedef void *Sfdisc_t; #endif /* global functions */ @@ -460,7 +458,9 @@ extern int pth_barrier_reach(pth_barrier_t *); /* extension functions */ +#if PTH_EXT_SFIO extern Sfdisc_t *pth_sfiodisc(void); +#endif /* generalized variants of replacement functions */ extern int pth_sigwait_ev(const sigset_t *, int *, pth_event_t); diff -u3 pth-1.4.0-orig/pth_ext.c pth-1.4.0/pth_ext.c --- pth-1.4.0-orig/pth_ext.c Sat Mar 24 15:49:57 2001 +++ pth-1.4.0/pth_ext.c Sun Dec 16 14:35:50 2001 @@ -82,11 +82,8 @@ return rv; } -#endif /* PTH_EXT_SFIO */ - Sfdisc_t *pth_sfiodisc(void) { -#if PTH_EXT_SFIO Sfdisc_t *disc; if ((disc = (Sfdisc_t *)malloc(sizeof(Sfdisc_t))) == NULL) @@ -96,8 +93,7 @@ disc->seekf = pth_sfio_seek; disc->exceptf = pth_sfio_except; return disc; -#else - return_errno(NULL, ENOSYS); -#endif /* PTH_EXT_SFIO */ } + +#endif /* PTH_EXT_SFIO */ ______________________________________________________________________ GNU Portable Threads (Pth) http://www.gnu.org/software/pth/ User Support Mailing List [EMAIL PROTECTED] Automated List Manager (Majordomo) [EMAIL PROTECTED]