From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6754 Path: news.gmane.org!not-for-mail From: Richard Gorton Newsgroups: gmane.linux.lib.musl.general Subject: the case for __MUSL__ Date: Mon, 29 Dec 2014 11:27:20 -0500 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1419870461 5804 80.91.229.3 (29 Dec 2014 16:27:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2014 16:27:41 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-6767-gllmg-musl=m.gmane.org@lists.openwall.com Mon Dec 29 17:27:36 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 1Y5dAN-000551-LC for gllmg-musl@m.gmane.org; Mon, 29 Dec 2014 17:27:35 +0100 Original-Received: (qmail 18211 invoked by uid 550); 29 Dec 2014 16:27:33 -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 18203 invoked from network); 29 Dec 2014 16:27:33 -0000 X-Mailer: Apple Mail (2.1510) Xref: news.gmane.org gmane.linux.lib.musl.general:6754 Archived-At: Hi, I'm working on getting C++ working for our target: we use clang, and = libcxx/libcxxabi libraries from llvm.org it seems to me (as I'm doing this) that instead of doing things like // Our compiler defines __COGNITIVE__ #if defined(__COGNITIVE__) It would make more sense to use #if defined(__MUSL__) I'm not proposing/suggesting use of this within musl itself, but for use = in other libraries (such as libcxx) which 'know' about the internal = implementation of libc. Thoughts & Comments appreciated An example case is in libcxx/src/locale.cpp, where there are bits of = code related to accessing the current locale: const ctype::mask* ctype::classic_table() _NOEXCEPT { #if defined(__APPLE__) || defined(__FreeBSD__) return _DefaultRuneLocale.__runetype; #elif defined(__NetBSD__) return _C_ctype_tab_ + 1; #elif defined(__GLIBC__) return __cloc()->__ctype_b; #elif __sun__ return __ctype_mask; #elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) return _ctype+1; // internal ctype mask table defined in msvcrt.dll // This is assumed to be safe, which is a nonsense assumption because = we're // going to end up dereferencing it later... #elif defined(__EMSCRIPTEN__) || defined(__COGNITIVE__) return *__ctype_b_loc(); #elif defined(_AIX) return (const unsigned int *)__lc_ctype_ptr->obj->mask; #elif defined(__ANDROID__) return _ctype_; #else // Platform not supported: abort so the person doing the port knows = what to // fix # warning ctype::classic_table() is not implemented printf("ctype::classic_table() is not implemented\n"); abort(); return NULL; #endif } Regards, Richard rcgorton@cog-e.com