Date: Wed, 19 May 2010 09:15:12 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Gabor PALI <pgj@freebsd.org>, hackers@freebsd.org Subject: Re: How to Include Headers for siginterrupt() and vsnprintf() Message-ID: <201005190915.12716.jhb@freebsd.org> In-Reply-To: <AANLkTinyDxZ19omwff0g4oF7Vf5FWR-M5p-_wP3WQ-J3@mail.gmail.com> References: <AANLkTinyDxZ19omwff0g4oF7Vf5FWR-M5p-_wP3WQ-J3@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 19 May 2010 6:52:04 am Gabor PALI wrote: > Hello there, > > I have some sources developed on non-FreeBSD systems (the sources of > the run-time system for the Glasgow Haskell Compiler [1]) which try to > #include signal.h to use siginterrupt() and stdio.h to use > vsnprintf(). The problem is that they #define (or not) some constants > which makes them hidden so the prototypes are not seen by the > compiler. How to cope with this kind of sources? My naive solution > is to do something like that (rts/posix/Signals.c): > > #if defined(HAVE_SIGNAL_H) > # if defined(freebsd_HOST_OS) > extern int siginterrupt(int,int); > # endif > # include <signal.h> > #endif > > and that (rts/eventlog/EventLog.c): > > #ifdef freebsd_HOST_OS > int vsnprintf(char * __restrict, size_t, const char * > __restrict,__va_list) __printflike(3, 0); > #endif > > > Thank you for the hints in advance. What do they do to hide the prototypes? Do they set a specific version of POSIX or ISO C that they wish to use? Probably the code should not be doing that. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005190915.12716.jhb>