From patchwork Fri Oct 4 02:00:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1171523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=uclibc.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=uclibc-bounces@uclibc.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T3wD1cI4"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ktPp6gdbz9sPl for ; Fri, 4 Oct 2019 12:00:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E69FC882B0; Fri, 4 Oct 2019 02:00:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Flz4whxa9pzp; Fri, 4 Oct 2019 02:00:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0EBF98836E; Fri, 4 Oct 2019 02:00:39 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 99B491BF397 for ; Fri, 4 Oct 2019 02:00:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 928DB8796B for ; Fri, 4 Oct 2019 02:00:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ERI13AQChUvG for ; Fri, 4 Oct 2019 02:00:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id C8B73878DE for ; Fri, 4 Oct 2019 02:00:36 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id a3so2799300pgm.13 for ; Thu, 03 Oct 2019 19:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=uVYpnqAcbTUrDuljI0HPvERJx4E9Dnb/ZIJsE3uTsoQ=; b=T3wD1cI4bUbiH22cfw+iOVuEaDTiZKGFyIprCY/dVJsjVqouVLVxLZXmaptpYjwn2i mBiJXcGiOT0QzcuhavliMh8Pbil+GyCsP6yzQD6Fz8bO0g0W7Tz8EfdVbhCT0H20zxz5 o1QaJp92CR7qvSS255HeTXLANpicGVXDOGBlncxzrOwN7k90iB2dE9vqNS546ZQWrZFt t5Fbk6DnTJCIlTYcpG2cIfWO49lOrlez62p38lTjAxzRsHRZx0yHJmENRHiofg89WWic y06C3+RuiE7xn0dJ1APM9RwLcQPZzzkM2uiusKIBCVcgLyRHEe9djAGPmzmBXL6Cfcbg y6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=uVYpnqAcbTUrDuljI0HPvERJx4E9Dnb/ZIJsE3uTsoQ=; b=nqGv88zBswaHkIiY+sZtBe73iruhbgCRBodSBh9nE1IMo810rvFir+JspdRC9l6c0j 8nAPZgNShmFPkoYY0Tt7KVVMn5koMJae2x72tbx5DhIOESv5IPDfwXwKHhUY98bn7O9a Lq8R64eOMQr9JCtI81GD1nyJKxcjKSt8D6pK7dmyrmiJjbNx++Ge5sWDkm5WOULZbtuA PJhh1kmspsAGBb4ejhGwxN7dOcnakT/2Lqkk7eZHiRdbEX5qZ1/8+Rkz+LN+5VhpwUym fkce2k8BQe4aehz0sgiNkpXBXpmQ5WX7gtPsPtjxe34q74SW4HdJM4rgLpWftTNFoEGP 8Xdw== X-Gm-Message-State: APjAAAVxoTM9JYNyIwZnw01IK2fq5Dr2ptZDfuyr7zdZs7KrfG+uhxw1 wnAa0IwfoL1XVl7YCwemv8hi1miO X-Google-Smtp-Source: APXvYqxS0OaIpJJe0tMslCaCGff56tVYnwWOgfZInK4DupAed0UF7z7mxsqioLizdIfeRYOUMSyYPg== X-Received: by 2002:a62:aa0f:: with SMTP id e15mr13908176pff.160.1570154435844; Thu, 03 Oct 2019 19:00:35 -0700 (PDT) Received: from mangix-pc.lan ([69.42.0.147]) by smtp.gmail.com with ESMTPSA id cx22sm3169447pjb.19.2019.10.03.19.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 19:00:35 -0700 (PDT) From: Rosen Penev To: uclibc@uclibc.org, rep.dot.nop@gmail.com Subject: [PATCH] uClibc++: Make long long available to C++11 Date: Thu, 3 Oct 2019 19:00:32 -0700 Message-Id: <20191004020032.4139-1-rosenp@gmail.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" C++11 makes long long available. It is no longer a GNU extension. Signed-off-by: Rosen Penev --- include/istream | 4 ++-- include/istream_helpers | 2 +- include/ostream | 8 ++++---- include/ostream_helpers | 8 ++++---- tests/sstreamtest.cpp | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/istream b/include/istream index 72a8834..2d58abd 100644 --- a/include/istream +++ b/include/istream @@ -72,7 +72,7 @@ namespace std{ basic_istream& operator>>(void*& p); basic_istream& operator>>(basic_streambuf* sb); -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) basic_istream& operator>>(long long& n); basic_istream& operator>>(unsigned long long& n); #endif @@ -455,7 +455,7 @@ namespace std{ return *this; } -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template _UCXXEXPORT basic_istream& basic_istream::operator>>(long long& n) { diff --git a/include/istream_helpers b/include/istream_helpers index d87e0c7..f2c793f 100644 --- a/include/istream_helpers +++ b/include/istream_helpers @@ -301,7 +301,7 @@ namespace std{ }; -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template class _UCXXEXPORT __istream_readin{ public: inline static void readin(basic_istream& stream, long long & var) diff --git a/include/ostream b/include/ostream index 289514c..3072589 100644 --- a/include/ostream +++ b/include/ostream @@ -85,7 +85,7 @@ namespace std { basic_ostream& operator<<(long double f); basic_ostream& operator<<(void* p); basic_ostream& operator<<(basic_streambuf* sb); -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) basic_ostream& operator<<(long long n); basic_ostream& operator<<(unsigned long long n); #endif @@ -221,7 +221,7 @@ namespace std { return *this; } -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template _UCXXEXPORT basic_ostream& basic_ostream::operator<<(long long n) { sentry s(*this); @@ -487,7 +487,7 @@ namespace std { #endif -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) //Support for output of long long data types @@ -509,7 +509,7 @@ template _UCXXEXPORT basic_ostream& } -#endif //__STRICT_ANSI__ +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) diff --git a/include/ostream_helpers b/include/ostream_helpers index fa50407..f4d33f9 100644 --- a/include/ostream_helpers +++ b/include/ostream_helpers @@ -142,7 +142,7 @@ namespace std{ } }; -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template class _UCXXEXPORT __ostream_printout{ public: @@ -237,7 +237,7 @@ namespace std{ }; -#endif //__STRICT_ANSI__ +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template class _UCXXEXPORT __ostream_printout{ public: @@ -357,7 +357,7 @@ namespace std{ } }; -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template class _UCXXEXPORT __ostream_printout{ public: @@ -428,7 +428,7 @@ namespace std{ }; -#endif //__STRICT_ANSI__ +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) template class _UCXXEXPORT __ostream_printout{ public: diff --git a/tests/sstreamtest.cpp b/tests/sstreamtest.cpp index 36b3470..ea946a9 100644 --- a/tests/sstreamtest.cpp +++ b/tests/sstreamtest.cpp @@ -9,7 +9,7 @@ int main(){ int i; std::string s; char c; -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) long long ll; unsigned long long ull; #endif @@ -32,7 +32,7 @@ int main(){ -#ifndef __STRICT_ANSI__ +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) a.str("678 76 54"); a >> ll >> ull >> s; std::cout << "ll (should be 678): " << ll << std::endl;