[vlc-commits] cachegen: fix when building without getopt

Hugo Beauzée-Luyssen git at videolan.org
Sat Feb 6 12:08:55 CET 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Jan 30 09:26:30 2016 +0100| [ce1325ed51a5ecd74fada640dc0d88ef3510c71a] | committer: Jean-Baptiste Kempf

cachegen: fix when building without getopt

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce1325ed51a5ecd74fada640dc0d88ef3510c71a
---

 bin/cachegen.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/cachegen.c b/bin/cachegen.c
index 4b1cc57..0e52559 100644
--- a/bin/cachegen.c
+++ b/bin/cachegen.c
@@ -51,6 +51,7 @@ int main (int argc, char *argv[])
 #ifdef _WIN32
     SetErrorMode(SEM_FAILCRITICALERRORS);
 #endif
+#ifdef HAVE_GETOPT_H
     static const struct option opts[] =
     {
         { "help",       no_argument,       NULL, 'h' },
@@ -73,6 +74,9 @@ int main (int argc, char *argv[])
                 usage (argv[0]);
                 return 1;
         }
+#else
+    int optind = 1;
+#endif
 
     for (int i = optind; i < argc; i++)
     {



More information about the vlc-commits mailing list