From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4F10F138331 for ; Fri, 23 Mar 2018 20:17:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78F14E09D9; Fri, 23 Mar 2018 20:17:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 53E28E09D9 for ; Fri, 23 Mar 2018 20:17:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 26ABC335C63 for ; Fri, 23 Mar 2018 20:17:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D86EC266 for ; Fri, 23 Mar 2018 20:17:42 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1521836218.ca282deea01374d6f01746432ce3f450bcf6ac9f.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: porting.h X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ca282deea01374d6f01746432ce3f450bcf6ac9f X-VCS-Branch: master Date: Fri, 23 Mar 2018 20:17:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 56fc0dd0-17db-4bc1-bf88-f8d60ad3179d X-Archives-Hash: a59314d659df464735f5055fd6525e8f commit: ca282deea01374d6f01746432ce3f450bcf6ac9f Author: Fabian Groffen gentoo org> AuthorDate: Fri Mar 23 20:16:58 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri Mar 23 20:16:58 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ca282dee getopt: add workaround for Solaris to silence compiler porting.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/porting.h b/porting.h index 206c6e3..b0225df 100644 --- a/porting.h +++ b/porting.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -52,6 +51,24 @@ #include +#if defined(__sun) && defined(__SVR4) +/* workaround non-const defined name in option struct, such that we + * don't get a zillion of warnings */ +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; +extern int getopt_long(int, char * const *, const char *, + const struct option *, int *); +#else +#include +#endif + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr))) #ifndef BUFSIZE