X-Account-Key: account1
X-UIDL: 2ae54598d05f70db132a0c8db3dc7111
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
Received: from lists.maptools.org (lothlorien.howardsilvan.com [127.0.0.1])
	by mail.howardsilvan.com (Postfix) with ESMTPS id 0D57A67214F
	for <faxguy@howardsilvan.com>; Mon, 13 Apr 2015 11:04:55 -0700 (PDT)
Received: from lists.maptools.org ([94.23.4.142] helo=lists.maptools.org)
	by lothlorien.howardsilvan.com
	with SMTP (2.3.3); 13 Apr 2015	11:04:55 -0800
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id AD2BB35C033;
	Mon, 13 Apr 2015 13:03:43 -0500 (EST)
Received: from homiemail-a38.g.dreamhost.com (homie.mail.dreamhost.com	[208.97.132.208])
	by lists.maptools.org (Postfix) with ESMTP id 60F6835C027
	for <tiff@lists.maptools.org>; Mon, 13 Apr 2015 13:03:35 -0500 (EST)
Received: from homiemail-a38.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a38.g.dreamhost.com (Postfix) with ESMTP id F2BD910AFC8
	for <tiff@lists.maptools.org>; Mon, 13 Apr 2015 11:03:46 -0700 (PDT)
Received: from [172.17.110.195] (unknown [74.222.153.110])	(using TLSv1
	with cipher AES128-SHA (128/128 bits))	(No client certificate requested)	(Authenticated sender: lg@larrygritz.com)
	by homiemail-a38.g.dreamhost.com (Postfix) with ESMTPSA id BAF3010AFC7
	for <tiff@lists.maptools.org>; Mon, 13 Apr 2015 11:03:46 -0700 (PDT)
From: Larry Gritz <lg@larrygritz.com>
Message-Id: <4B9249CD-6510-4463-AB34-1EEE9649A5C9@larrygritz.com>
Date: Mon, 13 Apr 2015 11:03:45 -0700
To: tiff@lists.maptools.org
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
X-Mailer: Apple Mail (2.1878.6)
Subject: [Tiff] Reliable way to detect library version
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-Assp-ID: lothlorien.howardsilvan.com m1-48295-02084
X-Assp-Session: 7FE0AD150428 (mail 1)
X-Assp-Detected-RIP: 74.222.153.110, 208.97.132.208
X-Assp-Source-IP: 74.222.153.110
X-Assp-Envelope-From: tiff-bounces@lists.maptools.org
X-Assp-Intended-For: faxguy@howardsilvan.com
X-Assp-Version: 2.3.3(14029) on lothlorien.howardsilvan.com
X-Assp-Server-TLS: yes
X-Assp-Delay: not delayed (whitelisted); 13 Apr 2015 11:04:56 -0800
X-Assp-Whitelisted: Yes (whitelistdb)
Return-Path: tiff-bounces@lists.maptools.org
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I had been using 

#if TIFFLIB_VERSION >= 20120922

to detect whether it was safe to use TIFFCreateEXIFDirectory (which is present in libtiff 4.x, but not 3.x), but it's recently come to my attention that libtiff 3.9.7 also defines TIFFLIB_VERSION as 20120922 but lacks that API call.

It seems clear to me now that I must have written this line comparing 3.9.6 versus 4.0.3 and assuming the number would increase monotonically for future versions, understandable given that the comment in tiffvers.h says:

	 * This define can be used in code that requires
	 * compilation-related definitions specific to a
	 * version or versions of the library.

But now I see that 4.0.2 has an older date than 3.9.7.

So... what's the best/official way to reliably detect which TIFF version we have, at build time, in order to avoid compilation errors when using newer API calls that may or may not be present in the installed libtiff on the build machine?


--
Larry Gritz
lg@larrygritz.com



_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/


