hyperic / sigar

System Information Gatherer And Reporter
http://sigar.hyperic.com/
Apache License 2.0
1.51k stars 504 forks source link

Compilation fails on Visual Studio 2017 (VS 15.0) #112

Open madscientist opened 6 years ago

madscientist commented 6 years ago

This patch is needed for (at least) Visual Studio 2017. Not sure about earlier versions.

--- a/bindings/java/src/jni/win32/eventlog.c    2010-04-28 17:00:00.000000000 -0400
+++ b/bindings/java/src/jni/win32/eventlog.c    2018-01-23 15:55:39.605908161 -0500
@@ -130,7 +130,8 @@
         }
     }

-    ptr = wcstok(msgdll, FILESEP);
+    LPWSTR ex;
+    ptr = wcstok(msgdll, FILESEP, &ex);
     while (ptr) {
         HINSTANCE hlib;

@@ -150,7 +151,7 @@
                 break;
             }
         }
-        ptr = wcstok(NULL, FILESEP);
+        ptr = wcstok(NULL, FILESEP, &ex);
     }

     if (msgbuf) {
zw3413 commented 6 years ago

I used the _wcstok(msgdll,FILESEP) instead of wcstok(msgdll,FILESEP,&ex), vs2015. Will be happy to talk if you have other founds.