forked from goplus/llcppg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gogensig:fix unexpect receiver reinit goplus#67
- Loading branch information
1 parent
63cdaab
commit a0e793a
Showing
6 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "comment", | ||
"include": ["temp.h","use.h"], | ||
"cplusplus":false | ||
} |
7 changes: 7 additions & 0 deletions
7
cmd/gogensig/convert/_testdata/receiver/conf/llcppg.symb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"mangle": "ares_dns_addr_to_ptr", | ||
"c++": "ares_dns_addr_to_ptr(const struct ares_addr *)", | ||
"go": "(*aresAddr).AresDnsAddrToPtr" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
===== temp.go ===== | ||
package receiver | ||
|
||
import ( | ||
"github.com/goplus/llgo/c" | ||
_ "unsafe" | ||
) | ||
|
||
type X__Uint32T c.Uint | ||
type InAddrT X__Uint32T | ||
|
||
type InAddr struct { | ||
SAddr InAddrT | ||
} | ||
|
||
type AresIn6Addr struct { | ||
X_S6Un struct { | ||
X_S6U8 [16]int8 | ||
} | ||
} | ||
|
||
===== use.go ===== | ||
package receiver | ||
|
||
import _ "unsafe" | ||
|
||
type AresAddr struct { | ||
Family c.Int | ||
Addr struct { | ||
Addr6 AresIn6Addr | ||
} | ||
} | ||
// llgo:link (*aresAddr).AresDnsAddrToPtr C.ares_dns_addr_to_ptr | ||
func (p *AresAddr) AresDnsAddrToPtr() *int8 { | ||
return nil | ||
} | ||
|
||
===== llcppg.pub ===== | ||
__uint32_t X__Uint32T | ||
ares_addr AresAddr | ||
ares_in6_addr AresIn6Addr | ||
in_addr InAddr | ||
in_addr_t InAddrT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
typedef unsigned int __uint32_t; | ||
typedef __uint32_t in_addr_t; | ||
struct in_addr { | ||
in_addr_t s_addr; | ||
}; | ||
|
||
struct ares_in6_addr { | ||
union { | ||
unsigned char _S6_u8[16]; | ||
} _S6_un; | ||
}; | ||
|
||
struct ares_addr { | ||
int family; | ||
|
||
union { | ||
struct in_addr addr4; | ||
struct ares_in6_addr addr6; | ||
} addr; | ||
}; | ||
|
||
#include "use.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
char *ares_dns_addr_to_ptr(const struct ares_addr *addr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters