From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:22:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5C6106566C; Mon, 28 Dec 2009 02:22:05 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 416F38FC0C; Mon, 28 Dec 2009 02:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2M52q075683; Mon, 28 Dec 2009 02:22:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2M5X9075681; Mon, 28 Dec 2009 02:22:05 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280222.nBS2M5X9075681@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201090 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 02:22:05 -0000 Author: kientzle Date: Mon Dec 28 02:22:04 2009 New Revision: 201090 URL: http://svn.freebsd.org/changeset/base/201090 Log: Portability: * some non-FreeBSD platforms do actually define __FBSDID() in sys/cdefs.h * Borland C Modified: head/lib/libarchive/archive_platform.h Modified: head/lib/libarchive/archive_platform.h ============================================================================== --- head/lib/libarchive/archive_platform.h Mon Dec 28 02:20:23 2009 (r201089) +++ head/lib/libarchive/archive_platform.h Mon Dec 28 02:22:04 2009 (r201090) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */ + /* * This header is the first thing included in any of the libarchive * source files. As far as possible, platform-specific issues should @@ -50,17 +52,27 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* It should be possible to get rid of this by extending the feature-test + * macros to cover Windows API functions, probably along with non-trivial + * refactoring of code to find structures that sit more cleanly on top of + * either Windows or Posix APIs. */ +#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) +#include "archive_windows.h" +#endif + /* * The config files define a lot of feature macros. The following * uses those macros to select/define replacements and include key * headers as required. */ -/* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -#ifdef __FreeBSD__ -#include /* For __FBSDID */ -#else -/* Just leaving this macro replacement empty leads to a dangling semicolon. */ +/* Get a real definition for __FBSDID if we can */ +#if HAVE_SYS_CDEFS_H +#include +#endif + +/* If not, define it so as to avoid dangling semicolons. */ +#ifndef __FBSDID #define __FBSDID(a) struct _undefined_hack #endif @@ -72,6 +84,26 @@ #include #endif +/* Borland warns about its own constants! */ +#if defined(__BORLANDC__) +# if HAVE_DECL_UINT64_MAX +# undef UINT64_MAX +# undef HAVE_DECL_UINT64_MAX +# endif +# if HAVE_DECL_UINT64_MIN +# undef UINT64_MIN +# undef HAVE_DECL_UINT64_MIN +# endif +# if HAVE_DECL_INT64_MAX +# undef INT64_MAX +# undef HAVE_DECL_INT64_MAX +# endif +# if HAVE_DECL_INT64_MIN +# undef INT64_MIN +# undef HAVE_DECL_INT64_MIN +# endif +#endif + /* Some platforms lack the standard *_MAX definitions. */ #if !HAVE_DECL_SIZE_MAX #define SIZE_MAX (~(size_t)0)