Port to Windows #3

Open
opened 2026-03-20 00:03:21 +00:00 by bemmesr · 0 comments
Owner

Wrap any unix‐only functions using #defines so that depending on the macros defined by the host platform the internals of the function make use of the appropriate #includes and system functions.

For example, clock_gettime() in main.c requires unistd.h, which will not compile on Windows. As such, any calls to clock_gettime() should be done through a wrapper who's definition depends on the presence of system macros described above.

For a successful implementation of this feature request:

  • Running ‘make all’ should successfully build the program on Windows and Linux (given that the appropriate dependencies are installed)
  • If the host platform is not identified, an error should be thrown using ‘#error’
  • As always, all tests should be passing (except any that were already failing)
Wrap any unix‐only functions using #defines so that depending on the [macros defined by the host platform](https://sourceforge.net/p/predef/wiki/OperatingSystems/) the internals of the function make use of the appropriate #includes and system functions. For example, clock_gettime() in main.c requires unistd.h, which will not compile on Windows. As such, any calls to clock_gettime() should be done through a wrapper who's definition depends on the presence of system macros described above. For a successful implementation of this feature request: - Running ‘make all’ should successfully build the program on Windows *and* Linux (given that the appropriate dependencies are installed) - If the host platform is not identified, an error should be thrown using ‘#error’ - As always, all tests should be passing (except any that were already failing)
bemmesr added this to the (deleted) project 2026-03-20 00:09:26 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bemmesr/ncurses_snake#3
No description provided.