Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2010 11:34:00 -0700
From:      Xin LI <delphij@delphij.net>
To:        freebsd-arch@freebsd.org, ports@freebsd.org
Cc:        Alexander Logvinov <avl@logvinov.com>, the_paya@gentoo.org
Subject:   [RFC] Reduce namespace pollution on zlib.h
Message-ID:  <4BACFE18.7010309@delphij.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000309060306060201000507
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

The recent zlib import has added some assumption that
_LARGEFILE_64_SOURCE is only defined on systems with System V style *64
interface.  Moreover, I have added _FILE_OFFSET_BITS = 64 definition
into zconf.h so that it would pick up the 64 bit interface properly.

This unfortunately could cause some namespace pollution.  As such, I
would propose the attached changes to zlib headers:

zconf.h:
 * If _LARGEFILE_64_SOURCE is defined, set __FreeBSD_LARGEFILE_64_SOURCE
and undefine it, as it would break zlib.h
 * If _FILE_OFFSET_BITS is undefined, set __FreeBSD_FILE_OFFSET_BITS and
define it as 64.

zlib.h:
 * If __FreeBSD_LARGEFILE_64_SOURCE is defined and _LARGEFILE_64_SOURCE
undefined, undefine __FreeBSD_LARGEFILE_64_SOURCE and define
_LARGEFILE_64_SOURCE.
 * If __FreeBSD_FILE_OFFSET_BITS is defined and _FILE_OFFSET_BITS is
defined, undefine both.

This approach is kind of mess, though, but would avoid massive changes
which I'd propose for next zlib release.

Comments?  Objections?

Cheers,
- -- 
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJLrP4XAAoJEATO+BI/yjfBk2YH/Ag38kdtjxAk0l2kdgnHPnZ7
Wf9uk+0ixgE8X2uHfkOeiVO99Ma47aFU/thS1qgXRIWqP/iQEMqOiUayubYnsCJk
K8quwzEuifM0hlIPzHxgzo5/e1O6GhUdIkJVJj+T//twG2BGXziYHMye/aph0iRa
kW5DEq469jBoz62N8FDn4iatZoXT5boBc0bE3GQCKJhUADbpC84vjCCHfdVx50mu
x5hEO88TNaWSn4AkPgs0xPBYQNM+w6t2g/CLNfylumIUVHcSs+v8sLKrxdqqvKNx
hn97KmDagy5BVaWaAFAqFclgfAVbjfa8NIaOr8egxnuVHXTzEzjHFUD7fS22Oqo=
=eOpg
-----END PGP SIGNATURE-----

--------------000309060306060201000507
Content-Type: text/plain;
 name="zlib.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="zlib.diff"

SW5kZXg6IGxpYi9saWJ6L3pjb25mLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGliL2xpYnovemNv
bmYuaAkocmV2aXNpb24gMjA1NjUxKQorKysgbGliL2xpYnovemNvbmYuaAkod29ya2luZyBj
b3B5KQpAQCAtMzc1LDYgKzM3NSwxMyBAQAogIyAgZW5kaWYKICNlbmRpZgogCisjaWYgZGVm
aW5lZChfX0ZyZWVCU0RfXykgJiYgZGVmaW5lZChfTEFSR0VGSUxFNjRfU09VUkNFKQorI2lm
ICFkZWZpbmVkKF9fRnJlZUJTRF9MQVJHRUZJTEU2NF9TT1VSQ0UpCisjZGVmaW5lIF9fRnJl
ZUJTRF9MQVJHRUZJTEU2NF9TT1VSQ0UKKyNlbmRpZgorI3VuZGVmIF9MQVJHRUZJTEU2NF9T
T1VSQ0UKKyNlbmRpZgorCiAjaWZkZWYgX0xBUkdFRklMRTY0X1NPVVJDRQogIyAgaW5jbHVk
ZSA8c3lzL3R5cGVzLmg+CiAjZW5kaWYKQEAgLTM5MSw2ICszOTgsOSBAQAogI2luY2x1ZGUg
PHN5cy90eXBlcy5oPgogI2RlZmluZQl6X29mZl90CW9mZl90CiAjaWZuZGVmIF9GSUxFX09G
RlNFVF9CSVRTCisjaWYgIWRlZmluZWQoX19GcmVlQlNEX0ZJTEVfT0ZGU0VUX0JJVFMpCisj
ZGVmaW5lIF9fRnJlZUJTRF9GSUxFX09GRlNFVF9CSVRTCisjZW5kaWYKICNkZWZpbmUgX0ZJ
TEVfT0ZGU0VUX0JJVFMgNjQKICNlbmRpZgogCkluZGV4OiBsaWIvbGliei96bGliLmgKPT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PQotLS0gbGliL2xpYnovemxpYi5oCShyZXZpc2lvbiAyMDU2NTEpCisrKyBs
aWIvbGliei96bGliLmgJKHdvcmtpbmcgY29weSkKQEAgLTE1OTcsNiArMTU5NywyMCBAQAog
WkVYVEVSTiBjb25zdCB1TG9uZ2YgKiBaRVhQT1JUIGdldF9jcmNfdGFibGUgICAgT0YoKHZv
aWQpKTsKIFpFWFRFUk4gaW50ICAgICAgICAgICAgWkVYUE9SVCBpbmZsYXRlVW5kZXJtaW5l
IE9GKCh6X3N0cmVhbXAsIGludCkpOwogCisjaWYgZGVmaW5lZChfX0ZyZWVCU0RfTEFSR0VG
SUxFNjRfU09VUkNFKQorI3VuZGVmIF9fRnJlZUJTRF9MQVJHRUZJTEU2NF9TT1VSQ0UKKyNp
ZiAhZGVmaW5lZChfTEFSR0VGSUxFNjRfU09VUkNFKQorI2RlZmluZSBfTEFSR0VGSUxFNjRf
U09VUkNFCisjZW5kaWYKKyNlbmRpZgorCisjaWYgZGVmaW5lZChfX0ZyZWVCU0RfRklMRV9P
RkZTRVRfQklUUykKKyN1bmRlZiBfX0ZyZWVCU0RfRklMRV9PRkZTRVRfQklUUworI2lmIGRl
ZmluZWQoX0ZJTEVfT0ZGU0VUX0JJVFMpCisjdW5kZWYgX0ZJTEVfT0ZGU0VUX0JJVFMKKyNl
bmRpZgorI2VuZGlmCisKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmCg==
--------------000309060306060201000507--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BACFE18.7010309>