File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ Semantic Versioning.
3333 the language standard.
3434* ` ((x)) => {} ` no longer crashes the parser with an assertion failure.
3535* Tests now pass if the user's locale is Italian (` it_IT.utf8 ` on Linux).
36- * The FreeBSD build now succeeds.
36+ * The FreeBSD build now succeeds and tests pass .
3737
3838## 2.5.0 (2022-05-23)
3939
Original file line number Diff line number Diff line change 403403#define QLJS_HAVE_SETJMP 0
404404#endif
405405
406+ #if !defined(QLJS_HAVE_SYS_THR_H) && defined(__has_include)
407+ #if __has_include(<sys/thr.h>)
408+ #define QLJS_HAVE_SYS_THR_H 1
409+ #endif
410+ #endif
411+ #if !defined(QLJS_HAVE_SYS_THR_H)
412+ #if defined(__FreeBSD__)
413+ #define QLJS_HAVE_SYS_THR_H 1
414+ #else
415+ #define QLJS_HAVE_SYS_THR_H 0
416+ #endif
417+ #endif
418+
406419#if !defined(QLJS_HAVE_INOTIFY)
407420#if defined(__linux__)
408421#define QLJS_HAVE_INOTIFY 1
Original file line number Diff line number Diff line change 2727#include < mach/thread_act.h>
2828#endif
2929
30+ #if QLJS_HAVE_SYS_THR_H
31+ #include < sys/thr.h>
32+ #endif
33+
3034#if QLJS_HAVE_GETTID
3135#include < sys/types.h>
3236#endif
@@ -204,6 +208,11 @@ std::uint64_t get_current_thread_id() noexcept {
204208 QLJS_ALWAYS_ASSERT (rc == KERN_SUCCESS);
205209 QLJS_ALWAYS_ASSERT (info_count == THREAD_IDENTIFIER_INFO_COUNT);
206210 return info.thread_id ;
211+ #elif QLJS_HAVE_SYS_THR_H
212+ long thread_id;
213+ int rc = ::thr_self (&thread_id);
214+ QLJS_ALWAYS_ASSERT (rc == 0 );
215+ return narrow_cast<std::uint64_t >(thread_id);
207216#else
208217#warning "Unsupported platform"
209218 return 0 ;
You can’t perform that action at this time.
0 commit comments