]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
Unicode compilation fix
[wxWidgets.git] / samples / console / console.cpp
index 35037e5b9781c5641f1fca15c241135204e9db68..51338a569063143b4e5ae92b8667c46fab024a90 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        samples/console/console.cpp
 /////////////////////////////////////////////////////////////////////////////
 // Name:        samples/console/console.cpp
-// Purpose:     a sample console (as opposed to GUI) progam using wxWidgets
+// Purpose:     A sample console (as opposed to GUI) program using wxWidgets
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     04.10.99
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     04.10.99
@@ -53,7 +53,7 @@
     #define TEST_CMDLINE
     #define TEST_DATETIME
     #define TEST_DIR
     #define TEST_CMDLINE
     #define TEST_DATETIME
     #define TEST_DIR
-    #define TEST_DLLLOADER
+    #define TEST_DYNLIB
     #define TEST_ENVIRON
     #define TEST_EXECUTE
     #define TEST_FILE
     #define TEST_ENVIRON
     #define TEST_EXECUTE
     #define TEST_FILE
@@ -85,7 +85,7 @@
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
-    #define TEST_STACKWALKER
+    #define TEST_DIR
 #endif
 
 // some tests are interactive, define this to run them
 #endif
 
 // some tests are interactive, define this to run them
@@ -201,7 +201,7 @@ static void TestCmdLineConvert()
 #ifdef __UNIX__
     static const wxChar *ROOTDIR = _T("/");
     static const wxChar *TESTDIR = _T("/usr/local/share");
 #ifdef __UNIX__
     static const wxChar *ROOTDIR = _T("/");
     static const wxChar *TESTDIR = _T("/usr/local/share");
-#elif defined(__WXMSW__)
+#elif defined(__WXMSW__) || defined(__DOS__)
     static const wxChar *ROOTDIR = _T("c:\\");
     static const wxChar *TESTDIR = _T("d:\\");
 #else
     static const wxChar *ROOTDIR = _T("c:\\");
     static const wxChar *TESTDIR = _T("d:\\");
 #else
@@ -372,7 +372,7 @@ static void TestDirExists()
 // wxDllLoader
 // ----------------------------------------------------------------------------
 
 // wxDllLoader
 // ----------------------------------------------------------------------------
 
-#ifdef TEST_DLLLOADER
+#ifdef TEST_DYNLIB
 
 #include "wx/dynlib.h"
 
 
 #include "wx/dynlib.h"
 
@@ -398,7 +398,7 @@ static void TestDllLoad()
     }
     else
     {
     }
     else
     {
-        typedef int (*wxStrlenType)(const char *);
+        typedef int (wxSTDCALL *wxStrlenType)(const char *);
         wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME);
         if ( !pfnStrlen )
         {
         wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME);
         if ( !pfnStrlen )
         {
@@ -419,6 +419,26 @@ static void TestDllLoad()
                 wxPuts(_T("... ok"));
             }
         }
                 wxPuts(_T("... ok"));
             }
         }
+
+#ifdef __WXMSW__
+        static const wxChar *FUNC_NAME_AW = _T("lstrlen");
+
+        typedef int (wxSTDCALL *wxStrlenTypeAorW)(const wxChar *);
+        wxStrlenTypeAorW
+            pfnStrlenAorW = (wxStrlenTypeAorW)lib.GetSymbolAorW(FUNC_NAME_AW);
+        if ( !pfnStrlenAorW )
+        {
+            wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"),
+                     FUNC_NAME_AW, LIB_NAME);
+        }
+        else
+        {
+            if ( pfnStrlenAorW(_T("foobar")) != 6 )
+            {
+                wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n"));
+            }
+        }
+#endif // __WXMSW__
     }
 }
 
     }
 }
 
@@ -450,7 +470,7 @@ static void TestDllListLoaded()
 
 #endif
 
 
 #endif
 
-#endif // TEST_DLLLOADER
+#endif // TEST_DYNLIB
 
 // ----------------------------------------------------------------------------
 // wxGet/SetEnv
 
 // ----------------------------------------------------------------------------
 // wxGet/SetEnv
@@ -2995,7 +3015,7 @@ static void TestVCardRead()
 
         wxPrintf(_T("Full name from wxVCard API: %s\n"), value.c_str());
 
 
         wxPrintf(_T("Full name from wxVCard API: %s\n"), value.c_str());
 
-        // now show how to deal with multiply occuring properties
+        // now show how to deal with multiply occurring properties
         DumpVCardAddresses(vcard);
         DumpVCardPhoneNumbers(vcard);
 
         DumpVCardAddresses(vcard);
         DumpVCardPhoneNumbers(vcard);
 
@@ -4119,10 +4139,10 @@ int main(int argc, char **argv)
     TestDirTraverse();
 #endif // TEST_DIR
 
     TestDirTraverse();
 #endif // TEST_DIR
 
-#ifdef TEST_DLLLOADER
+#ifdef TEST_DYNLIB
     TestDllLoad();
     TestDllListLoaded();
     TestDllLoad();
     TestDllListLoaded();
-#endif // TEST_DLLLOADER
+#endif // TEST_DYNLIB
 
 #ifdef TEST_ENVIRON
     TestEnvironment();
 
 #ifdef TEST_ENVIRON
     TestEnvironment();