kopia lustrzana https://github.com/Hamlib/Hamlib
Fix testrigcaps for ming32, ming64, and all others
Structure packing may be different yet on some other compilerspull/518/head
rodzic
619e130483
commit
fbce397f3b
|
@ -13,12 +13,18 @@ int main()
|
||||||
void *p2 = &rig->state.vfo_list;
|
void *p2 = &rig->state.vfo_list;
|
||||||
unsigned long offset = p2 - p1;
|
unsigned long offset = p2 - p1;
|
||||||
printf("offset vfo_list=%ld\n", offset);
|
printf("offset vfo_list=%ld\n", offset);
|
||||||
int expected = 13280;
|
#if defined(__MINGW32__)
|
||||||
int expected32 = 10144;
|
int expected = 10144; // mingw32
|
||||||
if (offset != expected && offset != expected32)
|
#elif defined(__MINGW64__)
|
||||||
|
int expected = 13264; // mingw64
|
||||||
|
#else
|
||||||
|
int expected = 13280; // should be most 64-bit compilers
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (offset != expected)
|
||||||
{
|
{
|
||||||
printf("offset of vfo_list has changed!!!\n");
|
printf("offset of vfo_list has changed!!!\n");
|
||||||
printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset );
|
printf("was %d, now %lu\n", expected, offset);
|
||||||
retcode = 1;
|
retcode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,12 +32,18 @@ int main()
|
||||||
offset = p2 - p1;
|
offset = p2 - p1;
|
||||||
printf("offset power_max=%ld\n", offset);
|
printf("offset power_max=%ld\n", offset);
|
||||||
|
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
expected = 10448; // mingw32
|
||||||
|
#elif defined(__MINGW64__)
|
||||||
|
expected = 13664; // mingw64
|
||||||
|
#else
|
||||||
expected = 13696;
|
expected = 13696;
|
||||||
expected32 = 10448;
|
#endif
|
||||||
if (offset != expected && offset != expected32)
|
|
||||||
|
if (offset != expected)
|
||||||
{
|
{
|
||||||
printf("offset of power_max has changed!!!\n");
|
printf("offset of power_max has changed!!!\n");
|
||||||
printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset );
|
printf("was %d, now %lu\n", expected, offset);
|
||||||
retcode = 1;
|
retcode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue