@@ -20,7 +20,8 @@ use self::gen::windows::foundation::collections::{
20
20
} ;
21
21
22
22
/// Represents a single UTF-16 character. This is the standard character type in WinRT.
23
- #[ derive( Clone , Copy ) ] #[ repr( C ) ]
23
+ #[ derive( Clone , Copy ) ]
24
+ #[ repr( transparent) ]
24
25
pub struct Char ( pub :: w:: ctypes:: wchar_t ) ; // TODO: deref to u16
25
26
26
27
/// Marker trait for all Windows Runtime interfaces. They must inherit from `IInspectable`.
@@ -276,11 +277,11 @@ macro_rules! RT_INTERFACE {
276
277
( $( #[ $attr: meta] ) * basic $interface: ident ( $vtbl: ident) : $pinterface: ident ( $pvtbl: ty) [ $iid: ident]
277
278
{ }
278
279
) => {
279
- #[ repr( C ) ] #[ allow( missing_copy_implementations) ] #[ doc( hidden) ]
280
+ #[ repr( transparent ) ] #[ allow( missing_copy_implementations) ] #[ doc( hidden) ]
280
281
pub struct $vtbl {
281
282
pub parent: $pvtbl
282
283
}
283
- $( #[ $attr] ) * #[ repr( C ) ] #[ allow( missing_copy_implementations) ]
284
+ $( #[ $attr] ) * #[ repr( transparent ) ] #[ allow( missing_copy_implementations) ]
284
285
pub struct $interface {
285
286
lpVtbl: * const $vtbl
286
287
}
@@ -329,7 +330,7 @@ macro_rules! RT_INTERFACE {
329
330
$( , $p: $t) *
330
331
) -> $rtr) +
331
332
}
332
- $( #[ $attr] ) * #[ repr( C ) ] #[ allow( missing_copy_implementations) ]
333
+ $( #[ $attr] ) * #[ repr( transparent ) ] #[ allow( missing_copy_implementations) ]
333
334
pub struct $interface {
334
335
lpVtbl: * const $vtbl
335
336
}
@@ -378,7 +379,7 @@ macro_rules! RT_INTERFACE {
378
379
$( , $p: $t) *
379
380
) -> $rtr) +
380
381
}
381
- $( #[ $attr] ) * #[ repr( C ) ] #[ allow( missing_copy_implementations) ]
382
+ $( #[ $attr] ) * #[ repr( transparent ) ] #[ allow( missing_copy_implementations) ]
382
383
pub struct $interface<$t1> where $t1: RtType {
383
384
lpVtbl: * const $vtbl<$t1>,
384
385
}
@@ -423,7 +424,7 @@ macro_rules! RT_INTERFACE {
423
424
$( , $p: $t) *
424
425
) -> $rtr) +
425
426
}
426
- $( #[ $attr] ) * #[ repr( C ) ] #[ allow( missing_copy_implementations) ]
427
+ $( #[ $attr] ) * #[ repr( transparent ) ] #[ allow( missing_copy_implementations) ]
427
428
pub struct $interface<$t1, $t2> where $t1: RtType , $t2: RtType {
428
429
lpVtbl: * const $vtbl<$t1, $t2>,
429
430
}
@@ -649,7 +650,8 @@ macro_rules! DEFINE_CLSID {
649
650
650
651
macro_rules! RT_ENUM {
651
652
{ enum $name: ident : $t: ty { $( $variant: ident = $value: expr, ) + } } => {
652
- #[ repr( C ) ] #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
653
+ #[ repr( transparent) ]
654
+ #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
653
655
#[ allow( non_upper_case_globals) ]
654
656
pub struct $name( pub $t) ;
655
657
0 commit comments