Skip to content

Commit 689e4dd

Browse files
authored
Fix syntax highlighting for java code block
1 parent dabdcd7 commit 689e4dd

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

www/DirectMapping.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@ only need register them within the static initializer of the defining class,
88
as in the example below. The `Native.register()` method takes the name of your
99
native library, the same as `Native.load()` would.
1010

11-
import com.sun.jna.*;
12-
13-
public class HelloWorld {
14-
15-
public static native double cos(double x);
16-
public static native double sin(double x);
17-
18-
static {
19-
Native.register(Platform.C_LIBRARY_NAME);
20-
}
21-
22-
public static void main(String[] args) {
23-
System.out.println("cos(0)=" + cos(0));
24-
System.out.println("sin(0)=" + sin(0));
25-
}
11+
```java
12+
import com.sun.jna.*;
13+
14+
public class HelloWorld {
15+
16+
public static native double cos(double x);
17+
public static native double sin(double x);
18+
19+
static {
20+
Native.register(Platform.C_LIBRARY_NAME);
2621
}
2722

23+
public static void main(String[] args) {
24+
System.out.println("cos(0)=" + cos(0));
25+
System.out.println("sin(0)=" + sin(0));
26+
}
27+
}
28+
```
29+
2830
Direct mapping supports the same type mappings as interface mapping, except for
2931
arrays of `Pointer`/`Structure`/`String`/`WString`/`NativeMapped` as function
3032
arguments. In addition, direct mapping does not support NIO Buffers or

0 commit comments

Comments
 (0)