From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6411 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: the prototype decl of memcpy/memcmp/calloc/free shouldnot in sched.h Date: Sat, 1 Nov 2014 17:22:30 +0100 Message-ID: <20141101162230.GH10829@port70.net> References: <20141031032410.GZ22465@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414858971 4678 80.91.229.3 (1 Nov 2014 16:22:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2014 16:22:51 +0000 (UTC) Cc: Rich Felker To: musl@lists.openwall.com Original-X-From: musl-return-6424-gllmg-musl=m.gmane.org@lists.openwall.com Sat Nov 01 17:22:44 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XkbRs-0005Oe-Jr for gllmg-musl@m.gmane.org; Sat, 01 Nov 2014 17:22:44 +0100 Original-Received: (qmail 1730 invoked by uid 550); 1 Nov 2014 16:22:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1722 invoked from network); 1 Nov 2014 16:22:42 -0000 Mail-Followup-To: musl@lists.openwall.com, Rich Felker Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:6411 Archived-At: * ????????? [2014-10-31 11:42:35 +0800]: > > In firefox, there is a system_wrapper header include sched.h, but in hunspell codes, calloc and free was redefined, so there is a conflicts here. > for example, in "extensions/spellcheck/hunspell/src/hunspell_alloc_hooks.h" > #define calloc(count, size) HunspellAllocator::CountingCalloc(count, size) > a simple fix for that in musl is void *(calloc)(size_t, size_t); or #define CPU_ALLOC(n) __cpu_alloc(n) static __inline cpu_set_t *__cpu_alloc(size_t _n) { extern void *(calloc)(size_t,size_t); return (calloc)(1,CPU_ALLOC_SIZE(_n)); } which almost gets the namespace right: only a non-function like calloc macro defined before sched.h would be an issue getting the namespace completely right would need a new extern identifier in musl that aliases or wraps calloc but _GNU_SOURCE has no well defined namespace requirement so it is hard to justify workarounds that spill over into other parts of the libc