Menu

#1730 Fix error when building with FreeRTOS.

v3.x
closed-fixed
gpz
None
SDL1x
Keyboard mapping
2023-12-17
2022-04-16
No

Hello,
I got an error when building my embedded version with FreeRTOS, but hopefully it is very easy to fix.
On top of vice/src/arch/shared/archdep_kbd_get_host_mapping.c there is a conditional preprocessor written like this:

#ifdef WINDOWS_COMPILE
# include <windows.h>
#endif
#if defined(UNIX_COMPILE)
# include <locale.h>
# include <string.h>
#endif

Later, into the code there is this:

#ifdef WINDOWS_COMPILE
...
#else
#if defined(BEOS_COMPILE)
...
#else
...
#endif
#endif

The problem with FreeRTOS, like any other not directly supported operating system, does not provide macros like WINDOWS_COMPILE, UNIX_COMPILE and so on.
So, the first conditional preprocessor does not include locale.h and string.h but later it falls down to use the symbols provide by those includes, which are obviously undefined.

The solution is to just respect the same order everywhere.
The fix provided into the attached patch just swaps the two pieces of code like this:

#ifdef WINDOWS_COMPILE
...
#elif defined(UNIX_COMPILE)
...
#else
...
#endif

to be exactly like it is on top of the file and so there is no code change for supported platforms.

1 Attachments

Discussion

  • gpz

    gpz - 2022-06-03

    applied in r42439 - thanks! (next time post patch on patches - i didnt see this one :))

     
  • gpz

    gpz - 2022-06-03
    • status: open --> pending-fixed
    • assigned_to: gpz
     
  • compyx

    compyx - 2023-12-17
    • status: pending-fixed --> closed-fixed
     
  • compyx

    compyx - 2023-12-17

    I'm assuming this is fixed.

     

Log in to post a comment.