소스 검색

Merge pull request #78 from willfindlay/main

aya: fix include_bytes_aligned! macro to work in some corner cases
Alessandro Decina 3 년 전
부모
커밋
56fd09c
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      aya/src/util.rs

+ 4 - 1
aya/src/util.rs

@@ -125,9 +125,12 @@ pub(crate) fn tc_handler_make(major: u32, minor: u32) -> u32 {
 #[macro_export]
 macro_rules! include_bytes_aligned {
     ($path:literal) => {{
+        #[repr(align(32))]
+        pub struct Aligned32;
+
         #[repr(C)]
         pub struct Aligned<Bytes: ?Sized> {
-            pub _align: [u32; 0],
+            pub _align: [Aligned32; 0],
             pub bytes: Bytes,
         }