5
5
#[ cfg( all( windows_raw_dylib, target_arch = "x86" ) ) ]
6
6
#[ macro_export]
7
7
macro_rules! link {
8
+ ( $library: literal "cdecl" $( $link_name: literal) ? fn $( $function: tt) * ) => (
9
+ $crate:: link!( $library "C" $( $link_name) ? fn $( $function) * ) ;
10
+ ) ;
8
11
( $library: literal $abi: literal $( $link_name: literal) ? fn $( $function: tt) * ) => (
9
12
#[ link( name = $library, kind = "raw-dylib" , modifiers = "+verbatim" , import_name_type = "undecorated" ) ]
10
13
extern $abi {
@@ -18,6 +21,9 @@ macro_rules! link {
18
21
#[ cfg( all( windows_raw_dylib, not( target_arch = "x86" ) ) ) ]
19
22
#[ macro_export]
20
23
macro_rules! link {
24
+ ( $library: literal "cdecl" $( $link_name: literal) ? fn $( $function: tt) * ) => (
25
+ $crate:: link!( $library "C" $( $link_name) ? fn $( $function) * ) ;
26
+ ) ;
21
27
( $library: literal $abi: literal $( $link_name: literal) ? fn $( $function: tt) * ) => (
22
28
#[ link( name = $library, kind = "raw-dylib" , modifiers = "+verbatim" ) ]
23
29
extern $abi {
@@ -31,6 +37,9 @@ macro_rules! link {
31
37
#[ cfg( all( windows, not( windows_raw_dylib) ) ) ]
32
38
#[ macro_export]
33
39
macro_rules! link {
40
+ ( $library: literal "cdecl" $( $link_name: literal) ? fn $( $function: tt) * ) => (
41
+ $crate:: link!( $library "C" $( $link_name) ? fn $( $function) * ) ;
42
+ ) ;
34
43
( $library: literal $abi: literal $( $link_name: literal) ? fn $( $function: tt) * ) => (
35
44
#[ link( name = "windows.0.53.0" ) ]
36
45
extern $abi {
@@ -44,6 +53,9 @@ macro_rules! link {
44
53
#[ cfg( all( not( windows) , not( windows_raw_dylib) ) ) ]
45
54
#[ macro_export]
46
55
macro_rules! link {
56
+ ( $library: literal "cdecl" $( $link_name: literal) ? fn $( $function: tt) * ) => (
57
+ $crate:: link!( $library "C" $( $link_name) ? fn $( $function) * ) ;
58
+ ) ;
47
59
( $library: literal $abi: literal $( $link_name: literal) ? fn $( $function: tt) * ) => (
48
60
extern $abi {
49
61
pub fn $( $function) * ;
0 commit comments