Fix regression bug that prevented compilation on 32-bit systems e.g. Raspberry Pi.

master
Teuniz 2023-02-09 11:13:07 +01:00
rodzic 76e3679c4f
commit c7bc6d1f81
2 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.38_2302082035"
#define PROGRAM_VERSION "0.39_2302091112"
#define MAX_PATHLEN (1024)

Wyświetl plik

@ -33,7 +33,6 @@ int main(int argc, char *argv[])
if((sizeof(char) != 1) ||
(sizeof(short) != 2) ||
(sizeof(int) != 4) ||
(sizeof(long) != 8) ||
(sizeof(long long) != 8) ||
(sizeof(float) != 4) ||
(sizeof(double) != 8))
@ -42,6 +41,20 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
#if defined(__LP64__)
if(sizeof(long) != 8)
{
fprintf(stderr, "Wrong compiler or platform!\n");
return EXIT_FAILURE;
}
#else
if(sizeof(long) != 4)
{
fprintf(stderr, "Wrong compiler or platform!\n");
return EXIT_FAILURE;
}
#endif
/* check endianness! */
byte_order_test_var.one = 0x03020100;
if((byte_order_test_var.four[0] != 0) ||