]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/init.h
Do not define __VISUALC__ for Intel C++ compiler under Windows.
[wxWidgets.git] / include / wx / init.h
index 5a66f42168d103d143f3e48acb4d3207b3fc9005..6ce8e82876c9f028eed72accbaad2fecb0908d41 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     29.06.2003
-// RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -53,15 +52,25 @@ extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv);
 
 #endif// wxUSE_UNICODE
 
+// Under Windows we define additional wxEntry() overloads with signature
+// compatible with WinMain() and not the traditional main().
+#if wxUSE_GUI && defined(__WINDOWS__)
+    #include "wx/msw/init.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // Using the library without (explicit) application object: you may avoid using
-// DECLARE_APP and IMPLEMENT_APP macros and call the functions below instead at
+// wxDECLARE_APP and wxIMPLEMENT_APP macros and call the functions below instead at
 // the program startup and termination
 // ----------------------------------------------------------------------------
 
 // initialize the library (may be called as many times as needed, but each
 // call to wxInitialize() must be matched by wxUninitialize())
-extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, wxChar **argv = NULL);
+extern bool WXDLLIMPEXP_BASE wxInitialize();
+extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, wxChar **argv);
+#if wxUSE_UNICODE
+extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, char **argv);
+#endif
 
 // clean up -- the library can't be used any more after the last call to
 // wxUninitialize()
@@ -73,10 +82,22 @@ class WXDLLIMPEXP_BASE wxInitializer
 {
 public:
     // initialize the library
-    wxInitializer(int argc = 0, wxChar **argv = NULL)
+    wxInitializer()
+    {
+        m_ok = wxInitialize();
+    }
+
+    wxInitializer(int argc, wxChar **argv)
+    {
+        m_ok = wxInitialize(argc, argv);
+    }
+
+#if wxUSE_UNICODE
+    wxInitializer(int argc, char **argv)
     {
         m_ok = wxInitialize(argc, argv);
     }
+#endif // wxUSE_UNICODE
 
     // has the initialization been successful? (explicit test)
     bool IsOk() const { return m_ok; }