X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=csharp_strings.py;fp=csharp_strings.py;h=9dd23d1f9f4c0e8b2c8541fa96a88f710b24b066;hb=fb92bb63a4dade8b58c9c648320f8feb9ad2ea5d;hp=17b0bf887e85ea68d4477ef7ee066f24b3e6ec9f;hpb=b7192bf70b04e446999a9ad6b632296887aec7bd;p=ldk-java diff --git a/csharp_strings.py b/csharp_strings.py index 17b0bf88..9dd23d1f 100644 --- a/csharp_strings.py +++ b/csharp_strings.py @@ -350,6 +350,18 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), _Static_assert(sizeof(void*) <= 8, "Pointers must fit into 64 bits"); +// Int types across Windows/Linux are different, so make sure we're using the right headers. +_Static_assert(sizeof(void*) == sizeof(uintptr_t), "stdints must be correct"); +_Static_assert(sizeof(void*) == sizeof(intptr_t), "stdints must be correct"); +_Static_assert(sizeof(uint64_t) == 8, "stdints must be correct"); +_Static_assert(sizeof(int64_t) == 8, "stdints must be correct"); +_Static_assert(sizeof(uint32_t) == 4, "stdints must be correct"); +_Static_assert(sizeof(int32_t) == 4, "stdints must be correct"); +_Static_assert(sizeof(uint16_t) == 2, "stdints must be correct"); +_Static_assert(sizeof(int16_t) == 2, "stdints must be correct"); +_Static_assert(sizeof(uint8_t) == 1, "stdints must be correct"); +_Static_assert(sizeof(int8_t) == 1, "stdints must be correct"); + #define DECL_ARR_TYPE(ty, name) \\ struct name##array { \\ uint64_t arr_len; /* uint32_t would suffice but we want to align uint64_ts as well */ \\