From owner-freebsd-hackers@FreeBSD.ORG Wed May 19 11:21:52 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A59106566B for ; Wed, 19 May 2010 11:21:52 +0000 (UTC) (envelope-from pali.gabor@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 552918FC13 for ; Wed, 19 May 2010 11:21:52 +0000 (UTC) Received: by mail-fx0-f54.google.com with SMTP id 4so889784fxm.13 for ; Wed, 19 May 2010 04:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=mXSsBVX2HqKm7RPkyIgz6iz9pgHG3vEYVTo1D10+4VY=; b=RASCyPmPQG2OrwANnPUGLYNis5Ve1fJjBHLm9O55QilWiThAu2jp4FbODeQlE7AFiE did45oSHJLIO+awf4An9uTgtd+VTowDv8S9N9w6YRcAKs2RZBctzLWQU4GLbItEhfN+J 4VN8nBLbC1jGWEEfsp8Y/FQ71n12cDiShx1As= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=gTx2SVFZri33Vas1Bx29OOLcQd66lrn4XT4Bc0BYge+4RKuBrlJqCWVzA4kP36nfXs sdg6pSx01+tSqAvNz8Sa7IAKDexfFudOUWKRpgVSWVx1i1GLQxUBD//N8yBi1ImA3YTO E9eCHYBkKHqN4unDnBIOt4fVBectC2VNX8Uik= MIME-Version: 1.0 Received: by 10.223.99.212 with SMTP id v20mr115857fan.44.1274266324725; Wed, 19 May 2010 03:52:04 -0700 (PDT) Sender: pali.gabor@googlemail.com Received: by 10.223.120.129 with HTTP; Wed, 19 May 2010 03:52:04 -0700 (PDT) Date: Wed, 19 May 2010 12:52:04 +0200 X-Google-Sender-Auth: GfiQWRVa8fOYfD7nzlk9DLMGO6Q Message-ID: From: Gabor PALI To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: How to Include Headers for siginterrupt() and vsnprintf() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2010 11:21:52 -0000 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 #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. Cheers, :g [1] http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=ghc;a=tree