[Libreoffice-commits] core.git: sal/Library_sal.mk sal/osl

Stephan Bergmann sbergman at redhat.com
Sat Mar 4 17:37:18 UTC 2017


 sal/Library_sal.mk       |    4 
 sal/osl/w32/dllentry.c   |  255 -----------------------------------------------
 sal/osl/w32/dllentry.cxx |  255 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 256 insertions(+), 258 deletions(-)

New commits:
commit 798dbea63a9ef060eb2ddcf69307eb1a666daae7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Mar 3 14:22:56 2017 +0100

    Change sal/osl/w32/dllentry.c -> .cxx
    
    Change-Id: I55f8bedd9b578053413b5e3404010301d01b7961
    Reviewed-on: https://gerrit.libreoffice.org/34861
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index e5585b9..4c04707 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -226,6 +226,7 @@ else # $(OS) == WNT
 $(eval $(call gb_Library_add_exception_objects,sal,\
 	sal/osl/w32/backtrace \
 	sal/osl/w32/conditn \
+	sal/osl/w32/dllentry \
 	sal/osl/w32/file \
 	sal/osl/w32/file_dirvol \
 	sal/osl/w32/file_error \
@@ -249,9 +250,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
 	sal/osl/w32/thread \
 	sal/osl/w32/time \
 ))
-$(eval $(call gb_Library_add_cobjects,sal,\
-	sal/osl/w32/dllentry \
-))
 
 endif # ifneq ($(OS),WNT)
 
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.cxx
similarity index 93%
rename from sal/osl/w32/dllentry.c
rename to sal/osl/w32/dllentry.cxx
index 6cb8669..5158979 100644
--- a/sal/osl/w32/dllentry.c
+++ b/sal/osl/w32/dllentry.cxx
@@ -57,14 +57,15 @@ _pRawDllMain()
 
 */
 
+extern "C" {
+
 static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved );
 BOOL (WINAPI *_pRawDllMain)(HINSTANCE, DWORD, LPVOID) = RawDllMain;
 
-static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
-{
-    (void)hinstDLL; /* avoid warnings */
-    (void)lpvReserved; /* avoid warnings */
+}
 
+static BOOL WINAPI RawDllMain( HINSTANCE, DWORD fdwReason, LPVOID )
+{
     switch (fdwReason)
     {
         case DLL_PROCESS_ATTACH:
@@ -184,7 +185,7 @@ static DWORD GetParentProcessId()
 
 static DWORD WINAPI ParentMonitorThreadProc( LPVOID lpParam )
 {
-    DWORD_PTR dwParentProcessId = (DWORD_PTR)lpParam;
+    DWORD_PTR dwParentProcessId = reinterpret_cast<DWORD_PTR>(lpParam);
 
     HANDLE  hParentProcess = OpenProcess( SYNCHRONIZE, FALSE, dwParentProcessId );
 
@@ -201,10 +202,9 @@ static DWORD WINAPI ParentMonitorThreadProc( LPVOID lpParam )
     return 0;
 }
 
-BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
+extern "C"
+BOOL WINAPI DllMain( HINSTANCE, DWORD fdwReason, LPVOID )
 {
-    (void)hinstDLL; /* avoid warning */
-    (void)lpvReserved; /* avoid warning */
     switch (fdwReason)
     {
         case DLL_PROCESS_ATTACH:
@@ -228,7 +228,7 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
                 {
                     // No error check, it works or it does not
                     // Thread should only be started for headless mode, see desktop/win32/source/officeloader.cxx
-                    CreateThread( NULL, 0, ParentMonitorThreadProc, (LPVOID)dwParentProcessId, 0, &dwThreadId );
+                    CreateThread( nullptr, 0, ParentMonitorThreadProc, reinterpret_cast<LPVOID>(dwParentProcessId), 0, &dwThreadId );
                     // Note: calling CreateThread in DllMain is discouraged
                     // but this is only done in the headless mode and in
                     // that case no other threads should be running at startup


More information about the Libreoffice-commits mailing list