main.cpp 947 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. ret = app.exec();
  32. #ifdef CONFIG_NATIVE_WINDOWS
  33. WSACleanup();
  34. #endif /* CONFIG_NATIVE_WINDOWS */
  35. return ret;
  36. }