main.cpp 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * wpa_gui - Application startup
  3. * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifdef CONFIG_NATIVE_WINDOWS
  15. #include <winsock.h>
  16. #endif /* CONFIG_NATIVE_WINDOWS */
  17. #include <QApplication>
  18. #include "wpagui.h"
  19. int main(int argc, char *argv[])
  20. {
  21. QApplication app(argc, argv);
  22. WpaGui w;
  23. int ret;
  24. #ifdef CONFIG_NATIVE_WINDOWS
  25. WSADATA wsaData;
  26. if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
  27. printf("Could not find a usable WinSock.dll\n");
  28. return -1;
  29. }
  30. #endif /* CONFIG_NATIVE_WINDOWS */
  31. w.show();
  32. ret = app.exec();
  33. #ifdef CONFIG_NATIVE_WINDOWS
  34. WSACleanup();
  35. #endif /* CONFIG_NATIVE_WINDOWS */
  36. return ret;
  37. }