From 5eec93b79577eccd20370bc440cad21f7592866c Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 1 Nov 2009 01:56:20 -0500 Subject: Make the __FBSDID() handling more platform-agnostic by using HAVE_SYS_CDEFS_H to control the inclusion of sys/cdefs.h and defining a fake __FBSDID() macro if we need one. In particular, this deals a lot more gracefully with systems that are not FreeBSD but use FreeBSD-derived system headers. See Issue 46 on libarchive.googlecode.com for discussion. Submitted by: cpr420 SVN-Revision: 1565 --- libarchive_fe/lafe_platform.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libarchive_fe') diff --git a/libarchive_fe/lafe_platform.h b/libarchive_fe/lafe_platform.h index dceb5aaf..557124b9 100644 --- a/libarchive_fe/lafe_platform.h +++ b/libarchive_fe/lafe_platform.h @@ -42,11 +42,13 @@ #include "config.h" #endif -/* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -#ifdef __FreeBSD__ -#include /* For __FBSDID */ -#elif !defined(__FBSDID) -/* 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 -- cgit v1.2.1