mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Make code compatible with jna 3.5.2 as well as 4.4.0
This commit is contained in:
@@ -17,10 +17,8 @@
|
||||
|
||||
package net.openhft.chronicle.hash.impl.util.jna;
|
||||
|
||||
import com.sun.jna.IntegerType;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.*;
|
||||
import net.openhft.chronicle.core.OS;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -36,7 +34,8 @@ public final class PosixMsync {
|
||||
private static native int msync(Pointer addr, size_t length, int flags);
|
||||
|
||||
static {
|
||||
Native.register(PosixMsync.class, Platform.C_LIBRARY_NAME);
|
||||
NativeLibrary clib = NativeLibrary.getInstance(Platform.C_LIBRARY_NAME);
|
||||
Native.register(PosixMsync.class, clib);
|
||||
}
|
||||
|
||||
private PosixMsync() {}
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class WindowsMsync {
|
||||
// Finally calls FlushFileBuffers
|
||||
raf.getChannel().force(false);
|
||||
} else {
|
||||
throw new IOException(Kernel32Util.formatMessage(lastError));
|
||||
throw new IOException(Kernel32Util.formatMessageFromLastErrorCode(lastError));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user