]> git.sesse.net Git - vlc/blobdiff - src/extras/getopt.c
Win32: fix src/ compilation
[vlc] / src / extras / getopt.c
index a016a6df1f6a08b14a7fcce5e1333463dcdee3af..fe301f4f8ac8d4c1689926e1549d9bf37665d70b 100644 (file)
@@ -33,6 +33,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#include <vlc_common.h>
 
 #if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
@@ -92,7 +93,7 @@
    When compiling libc, the _ macro is predefined.  */
 #ifdef HAVE_LIBINTL_H
 #include <libintl.h>
-#define _(msgid)    gettext (msgid)
+#define _(msgid)    vlc_gettext (msgid)
 #else
 #define _(msgid)    (msgid)
 #endif
@@ -358,6 +359,8 @@ static const char *
      char *const *argv;
      const char *optstring;
 {
+    (void)argc;
+    (void)argv;
     /* Start processing options with ARGV-element 1 (since ARGV-element 0
        is the program name); the sequence of previously skipped
        non-option ARGV-elements is empty.  */
@@ -707,12 +710,15 @@ int
             {
                 if (argv[optind][1] == '-')
                     /* --option */
-                    fprintf(stderr, _("%s: unrecognized option `--%s'\n"),
-                        argv[0], nextchar);
+                    fprintf(stderr, _("%s: unrecognized option `%s%s'\n"),
+                            "--", argv[0], nextchar);
                 else
+                {
+                    char t[2] = { argv[optind][0], '\0' };
                     /* +option or -option */
-                    fprintf(stderr, _("%s: unrecognized option `%c%s'\n"),
-                    argv[0], argv[optind][0], nextchar);
+                    fprintf(stderr, _("%s: unrecognized option `%s%s'\n"),
+                            argv[0], t, nextchar);
+                }
             }
             nextchar = (char *) "";
             optind++;