Skip to content

Commit ff60679

Browse files
committed
JNAerator: accept orphaned "extern "C" {" prefixes and "}" suffixes
1 parent fa06911 commit ff60679

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

  • libraries
    • DirectX/src/main/jnaerator
    • jnaerator/jnaerator-parser/src/main/antlr3/com/ochafik/lang/jnaerator/parser

libraries/DirectX/src/main/jnaerator/config.jnaerator

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,25 @@
22
-D_MSC_VER=1300
33
-DMIDL_PASS=1
44
-DHRESULT=int
5+
-DDWORD=int
6+
-DBYTE=char
7+
-DSIZE_T=size_t
58
-D__stdcall=
69
-D__cplusplus=1
710
"-DMIDL_INTERFACE(x)=struct __declspec(uuid(x)) __declspec(novtable)"
811

912
"-IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
13+
14+
//-library d3d9
15+
// "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\d3d9*.h"
1016
-library d3d10
1117
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\d3d10.h"
12-
-library d3d11
13-
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\d3d11.h"
18+
//-library d3d11
19+
// "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\d3d11.h"
1420

1521
-noJar -noComp
1622
-o src/main/java
17-
-v
23+
//-v
1824

1925
-runtime BridJ
20-
-parseInOneChunk
26+
//-parseInOneChunk

libraries/jnaerator/jnaerator-parser/src/main/antlr3/com/ochafik/lang/jnaerator/parser/ObjCpp.g

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ scope Symbols;
389389
lineDirective {
390390
if ($sourceFile.getElementFile() == null)
391391
$sourceFile.setElementFile(getFile());
392-
}
392+
} |
393+
{ next("extern") }?=> IDENTIFIER STRING '{' |
394+
'}'
393395
)*
394396
EOF
395397
;

0 commit comments

Comments
 (0)