[vlc-devel] commit: Use LoadLibrary instead of LoadLibraryA. (Sam Hocevar )

git version control git at videolan.org
Wed Mar 19 16:51:29 CET 2008


vlc | branch: master | Sam Hocevar <sam at zoy.org> | Wed Mar 19 13:53:57 2008 +0000| [48d8e6bf030cbb4f64d8dafcd8587489c088bbf7]

Use LoadLibrary instead of LoadLibraryA.

LoadLibrary can either point to LoadLibraryA or LoadLibraryW depending
on the system and build options, so let's use LoadLibrary everywhere
for consistency. Also, wrap static argument strings with _T() so that
they're automatically in the right format.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=48d8e6bf030cbb4f64d8dafcd8587489c088bbf7
---

 src/misc/mtime.c   |    4 ++--
 src/misc/threads.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index a06f021..dfd6d73 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -225,12 +225,12 @@ mtime_t mdate( void )
            (may also be true, for single cores with adaptive
             CPU frequency and active power management?)
         */
-        HINSTANCE h_Kernel32 = LoadLibraryA("kernel32.dll");
+        HINSTANCE h_Kernel32 = LoadLibrary(_T("kernel32.dll"));
         if(h_Kernel32)
         {
             void WINAPI (*pf_GetSystemInfo)(LPSYSTEM_INFO);
             pf_GetSystemInfo = (void WINAPI (*)(LPSYSTEM_INFO))
-                                GetProcAddress(h_Kernel32, "GetSystemInfo");
+                                GetProcAddress(h_Kernel32, _T("GetSystemInfo"));
             if(pf_GetSystemInfo)
             {
                SYSTEM_INFO system_info;
diff --git a/src/misc/threads.c b/src/misc/threads.c
index e547d0c..23dcf71 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -174,12 +174,12 @@ int __vlc_threads_init( vlc_object_t *p_this )
             HINSTANCE hInstLib;
 
             /* We are running on NT/2K/XP, we can use SignalObjectAndWait */
-            hInstLib = LoadLibrary( "kernel32" );
+            hInstLib = LoadLibrary(_T("kernel32"));
             if( hInstLib )
             {
                 pf_SignalObjectAndWait =
                     (SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib,
-                                                     "SignalObjectAndWait" );
+                                                  _T("SignalObjectAndWait") );
             }
         }
 




More information about the vlc-devel mailing list