summaryrefslogtreecommitdiff
path: root/security/opensc/patches/patch-src_common_compat__getopt.h
blob: 1389c9ee5293500e14a73dba48fe24bcf8becf92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$NetBSD: patch-src_common_compat__getopt.h,v 1.3 2015/09/07 19:59:42 gdt Exp $

NetBSD has getopt_long but not getopt_long_only.  Replacing
getopt_long causes a type conflict with the built-in implementation.
The replacement is unnecesssary because getopt_long_only is not
actually used.

Reported upstream:
http://article.gmane.org/gmane.comp.encryption.opensc.user/5931

The following is the original mail archive URL, but it currently
yields a '404 not found' error:
https://www.opensc-project.org/pipermail/opensc-devel/2012-November/018668.html

--- src/common/compat_getopt.h.orig	2015-05-16 20:30:24.000000000 +0000
+++ src/common/compat_getopt.h
@@ -30,7 +30,7 @@
 #include "config.h"
 #endif
 
-#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) && defined(HAVE_GETOPT_LONG_ONLY)
+#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG)
 #include <getopt.h>
 #else
 
@@ -43,7 +43,6 @@ extern "C" {
 
 #define getopt my_getopt
 #define getopt_long my_getopt_long
-#define getopt_long_only my_getopt_long_only
 #define _getopt_internal _my_getopt_internal
 #define opterr my_opterr
 #define optind my_optind
@@ -86,6 +85,6 @@ extern int _my_getopt_internal(int argc,
 }
 #endif
 
-#endif /* HAVE_GETOPT_H && HAVE_GETOPT_LONG && HAVE_GETOPT_LONG_ONLY */
+#endif /* HAVE_GETOPT_H && HAVE_GETOPT_LONG */
 
 #endif /* MY_GETOPT_H_INCLUDED */