Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 29fed89

Browse files
MSLaguanachakrabot
authored andcommitted
deps: update ChakraCore to chakra-core/ChakraCore@3e739383a5
[MERGE #4396 @obastemur] osx: fix osx binary backward compatibility Merge pull request #4396 from obastemur:fix_build_osx_bb1 Fixes #4393 Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
1 parent 7bee32c commit 29fed89

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

deps/chakrashim/core/pal/src/configure.cmake

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,12 @@ check_cxx_source_runs("
342342
int main()
343343
{
344344
int ret;
345+
#ifndef __APPLE__
345346
struct timespec ts;
346347
ret = clock_gettime(CLOCK_REALTIME, &ts);
347-
348+
#else
349+
ret = 1; // do not use clock_gettime on osx/ios (backward compatibility)
350+
#endif
348351
exit(ret);
349352
}" HAVE_WORKING_CLOCK_GETTIME)
350353
check_cxx_source_runs("
@@ -355,9 +358,12 @@ check_cxx_source_runs("
355358
int main()
356359
{
357360
int ret;
361+
#ifndef __APPLE__
358362
struct timespec ts;
359363
ret = clock_gettime(CLOCK_MONOTONIC, &ts);
360-
364+
#else
365+
ret = 1; // do not use clock_gettime on osx/ios (backward compatibility)
366+
#endif
361367
exit(ret);
362368
}" HAVE_CLOCK_MONOTONIC)
363369
check_cxx_source_runs("
@@ -368,9 +374,12 @@ check_cxx_source_runs("
368374
int main()
369375
{
370376
int ret;
377+
#ifndef __APPLE__
371378
struct timespec ts;
372379
ret = clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
373-
380+
#else
381+
ret = 1; // do not use clock_gettime on osx/ios (backward compatibility)
382+
#endif
374383
exit(ret);
375384
}" HAVE_CLOCK_MONOTONIC_COARSE)
376385
check_cxx_source_runs("
@@ -393,9 +402,12 @@ check_cxx_source_runs("
393402
int main()
394403
{
395404
int ret;
405+
#ifndef __APPLE__
396406
struct timespec ts;
397407
ret = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
398-
408+
#else
409+
ret = 1; // do not use clock_gettime on osx/ios (backward compatibility)
410+
#endif
399411
exit(ret);
400412
}" HAVE_CLOCK_THREAD_CPUTIME)
401413
check_cxx_source_runs("

deps/chakrashim/core/pal/src/misc/time.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ GetTickCount64Fallback()
329329
{
330330
ULONGLONG retval = 0;
331331

332-
#if HAVE_CLOCK_MONOTONIC_COARSE || HAVE_CLOCK_MONOTONIC
332+
// The `__APPLE__` below is unlikely. However, if osx future version
333+
// supports one of the clock types below, we may miss that and
334+
// break backward compatibility.
335+
#if !defined(__APPLE__) && (HAVE_CLOCK_MONOTONIC_COARSE || HAVE_CLOCK_MONOTONIC)
333336
{
334337
clockid_t clockType =
335338
#if HAVE_CLOCK_MONOTONIC_COARSE

0 commit comments

Comments
 (0)