Просмотр исходного кода

time: include threads.h for c11_thrd__yield (#546)

time_sleep() calls c11_thrd__yield() when PK_ENABLE_THREADS is set,
but time.c does not include pocketpy/common/threads.h. This only
builds with the CMake Unity build, where an earlier translation unit
pulls in the header. With PK_BUILD_WITH_UNITY=OFF it fails with:

  error: implicit declaration of function 'c11_thrd__yield'

Assisted-by: GitHub Copilot:claude-opus-5.5

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Ankur Tyagi 1 день назад
Родитель
Сommit
a5e85f4cad
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      src/modules/time.c

+ 1 - 0
src/modules/time.c

@@ -10,6 +10,7 @@
 #endif
 #endif
 
 
 #include "pocketpy/pocketpy.h"
 #include "pocketpy/pocketpy.h"
+#include "pocketpy/common/threads.h"
 #include <assert.h>
 #include <assert.h>
 
 
 #define NANOS_PER_SEC 1000000000
 #define NANOS_PER_SEC 1000000000