From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Problem with library images on Windows (again) Date: Fri, 20 May 2005 12:42:09 +0200 Message-ID: References: <01c55c26$Blat.v2.4$0ef86680@zahav.net.il> <01c55ca5$Blat.v2.4$dd149500@zahav.net.il> <01c55d0c$Blat.v2.4$8d418800@zahav.net.il> <428DB8F3.3070108@gnu.org> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1116588842 9747 80.91.229.2 (20 May 2005 11:34:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 May 2005 11:34:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 20 13:34:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DZ5iZ-0001mC-HV for ged-emacs-devel@m.gmane.org; Fri, 20 May 2005 13:31:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DZ5lP-0008Q6-18 for ged-emacs-devel@m.gmane.org; Fri, 20 May 2005 07:33:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DZ50c-0004IN-BY for emacs-devel@gnu.org; Fri, 20 May 2005 06:45:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DZ50Z-0004I6-UJ for emacs-devel@gnu.org; Fri, 20 May 2005 06:45:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DZ4z7-0003OV-SN for emacs-devel@gnu.org; Fri, 20 May 2005 06:44:06 -0400 Original-Received: from [64.233.184.207] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DZ55h-0003TF-22 for emacs-devel@gnu.org; Fri, 20 May 2005 06:50:53 -0400 Original-Received: by wproxy.gmail.com with SMTP id 50so1108160wri for ; Fri, 20 May 2005 03:42:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PxRH/rxKXlObFEsg5PAjotiDhUw4E+ozurKAuZPtIOQlCfnPOhSuX3Bbsj+n4CTJfXK8OnRM/cmsfi+0z6QqFCSdYY/b6hf681Qa6yr8tWkYvkUHCRWCCK9nuSZXJZU0xbAnC8nv1I2GWYwkSo2f6IWUuYqcG+hWM/PQI4cJ7GM= Original-Received: by 10.54.10.61 with SMTP id 61mr1624823wrj; Fri, 20 May 2005 03:42:09 -0700 (PDT) Original-Received: by 10.54.82.6 with HTTP; Fri, 20 May 2005 03:42:09 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: <428DB8F3.3070108@gnu.org> Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37386 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37386 > The version of TIFF headers I have uses extern "C" if compiling under > C++, so I doubt the library is using Pascal calling conventions. > Maybe Juanma's library is different than mine. Unless I'm wrong, the issue is not how the functions are defined on the headers, because we don't statically link against the functions, but how are they compiled in the library and how do we define the fn_XXX pointers to them. In this case, the GnuWin32 TIFF 3.7.2 libraries seem to be compiled to use C calling conventions, but we declare pointers to them with DEF_IMGLIB_FN, which says unequivocally that they're FARPROC (i.e, "pascal"). Defining typedef int (FAR CDECL *CFARPROC)(); #define DEF_IMGLIB_FNC(func) CFARPROC fn_##func and using DEF_IMGLIB_FNC for the Tiff functions works. The TIFF page in gnuwin32.sourceforge.net says: "The GnuWin32 distribution comes in two versions. The ordinary version uses the standard Unix equivalents, such as fopen and read, for input and output, the other version (Tiff-win32) uses the Win32 API functions, such as CreateFile and ReadFile, for input and output. The ordinary version (Tiff) is more suitable for porting Unix programs, the Win32-API version is more suitable for writing Win32 programs." However, I'm getting the same results (problems, I mean) with the standard and the Win32 versions. --=20 /L/e/k/t/u