Skip to content

Commit

Permalink
adjust windows package to JDK 21
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Aug 4, 2023
1 parent fa3ccda commit 3a1a490
Show file tree
Hide file tree
Showing 78 changed files with 4,379 additions and 3,512 deletions.
4 changes: 3 additions & 1 deletion jfuse-win/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<executable>${jextract.executable}</executable>
<headerSearchPaths>${win.ucrtHeaderPath}</headerSearchPaths>
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
<targetPackage>org.cryptomator.jfuse.win.extr</targetPackage>
<targetPackage>org.cryptomator.jfuse.win.extr.fuse3</targetPackage>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -145,6 +145,7 @@
<goal>sources</goal>
</goals>
<configuration>
<targetPackage>org.cryptomator.jfuse.win.extr.errno</targetPackage>
<headerFile>${win.ucrtHeaderPath}/errno.h</headerFile>
<headerClassName>errno_h</headerClassName>
<includeConstants>
Expand Down Expand Up @@ -173,6 +174,7 @@
<goal>sources</goal>
</goals>
<configuration>
<targetPackage>org.cryptomator.jfuse.win.extr.fcntl</targetPackage>
<headerFile>${win.ucrtHeaderPath}/fcntl.h</headerFile>
<headerClassName>fcntl_h</headerClassName>
<includeConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.cryptomator.jfuse.api.DirFiller;
import org.cryptomator.jfuse.api.Stat;
import org.cryptomator.jfuse.win.extr.fuse3_fill_dir_t;
import org.cryptomator.jfuse.win.extr.fuse_stat;
import org.cryptomator.jfuse.win.extr.fuse3.fuse3_fill_dir_t;
import org.cryptomator.jfuse.win.extr.fuse3.fuse_stat;

import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
Expand All @@ -12,7 +12,7 @@
record DirFillerImpl(MemorySegment buf, fuse3_fill_dir_t callback, Arena arena) implements DirFiller {

DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) {
this(buf, fuse3_fill_dir_t.ofAddress(callback, arena.scope()), arena);
this(buf, fuse3_fill_dir_t.ofAddress(callback, arena), arena);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.cryptomator.jfuse.win;

import org.cryptomator.jfuse.api.FileInfo;
import org.cryptomator.jfuse.win.extr.fcntl_h;
import org.cryptomator.jfuse.win.extr.fuse3_file_info;
import org.cryptomator.jfuse.win.extr.fcntl.fcntl_h;
import org.cryptomator.jfuse.win.extr.fuse3.fuse3_file_info;

import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentScope;
import java.nio.file.StandardOpenOption;
import java.util.EnumSet;
import java.util.Set;
Expand All @@ -20,7 +20,7 @@ record FileInfoImpl(MemorySegment segment) implements FileInfo {
private static final int O_TRUNC = fcntl_h.O_TRUNC();
private static final int O_EXCL = fcntl_h.O_EXCL();

public FileInfoImpl(MemorySegment address, SegmentScope scope) {
public FileInfoImpl(MemorySegment address, Arena scope) {
this(fuse3_file_info.ofAddress(address, scope));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public String toString() {
var argc = fuse_args.argc$get(args);
var argv = fuse_args.argv$get(args);
for (int i = 0; i < argc; i++) {
var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i);
var cString = argv.getAtIndex(ValueLayout.ADDRESS.withoutTargetLayout().withName("arg[%d]".formatted(i)), i).reinterpret(Long.MAX_VALUE);
sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", ");
}
sb.append("mountPoint = ").append(mountPoint().getUtf8String(0));
sb.append("mountPoint = ").append(mountPoint().reinterpret(Long.MAX_VALUE).getUtf8String(0)).append(", ");
sb.append("singlethreaded = ").append(!multiThreaded);
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.cryptomator.jfuse.win;

import org.cryptomator.jfuse.api.FuseConfig;
import org.cryptomator.jfuse.win.extr.fuse3_config;
import org.cryptomator.jfuse.win.extr.fuse3.fuse3_config;

import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentScope;

record FuseConfigImpl(MemorySegment segment) implements FuseConfig {

public FuseConfigImpl(MemorySegment address, SegmentScope scope) {
public FuseConfigImpl(MemorySegment address, Arena scope) {
this(fuse3_config.ofAddress(address, scope));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.cryptomator.jfuse.win;

import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.win.extr.fuse3_conn_info;
import org.cryptomator.jfuse.win.extr.fuse3.fuse3_conn_info;

import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentScope;

record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo {

public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) {
public FuseConnInfoImpl(MemorySegment address, Arena scope) {
this(fuse3_conn_info.ofAddress(address, scope));
}

Expand Down
Loading

0 comments on commit 3a1a490

Please sign in to comment.