Patchwork wpa_gui: fix FTBFS with gcc/g++ 4.7

login
register
mail settings
Submitter Stefan Lippers-Hollmann
Date July 3, 2012, 2:17 a.m.
Message ID <201207030417.24685.s.L-H@gmx.de>
Download mbox | patch
Permalink /patch/168669/
State Accepted
Commit 46d69fa5c6d3c27f2ad294d4e161c01e3b4f75df
Headers show

Comments

Stefan Lippers-Hollmann - July 3, 2012, 2:17 a.m.
g++ -c -m64 -pipe -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -Wall -W -D_REENTRANT -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.. -I../../src -I../../src/utils -I.moc -I.ui -o .obj/wpagui.o wpagui.cpp
wpagui.cpp: In member function 'virtual void WpaGui::parse_argv()':
wpagui.cpp:246:49: error: 'getopt' was not declared in this scope
wpagui.cpp:252:24: error: 'optarg' was not declared in this scope
make[2]: *** [.obj/wpagui.o] Error 1

From: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
intended-for: hostap-1
---
Debian bug #667416, http://bugs.debian.org/667416
successfully built on all Debian architectures:
https://buildd.debian.org/status/logs.php?pkg=wpa&ver=1.0-2

 wpa_supplicant/wpa_gui-qt4/wpagui.cpp |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
Jouni Malinen - July 4, 2012, 6:03 p.m.
On Tue, Jul 03, 2012 at 04:17:19AM +0200, Stefan Lippers-Hollmann wrote:
> wpagui.cpp: In member function 'virtual void WpaGui::parse_argv()':
> wpagui.cpp:246:49: error: 'getopt' was not declared in this scope
> wpagui.cpp:252:24: error: 'optarg' was not declared in this scope
> make[2]: *** [.obj/wpagui.o] Error 1

Thanks, applied.

Patch

diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index 46cfc8f..42e14f0 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -6,16 +6,12 @@ 
  * See README for more details.
  */
 
-#ifdef __MINGW32__
-/* Need to get getopt() */
-#include <unistd.h>
-#endif
-
 #ifdef CONFIG_NATIVE_WINDOWS
 #include <windows.h>
 #endif /* CONFIG_NATIVE_WINDOWS */
 
 #include <cstdio>
+#include <unistd.h>
 #include <QMessageBox>
 #include <QCloseEvent>
 #include <QImageReader>