File tree Expand file tree Collapse file tree 6 files changed +17
-24
lines changed Expand file tree Collapse file tree 6 files changed +17
-24
lines changed Original file line number Diff line number Diff line change @@ -211,16 +211,6 @@ if(FEATURE_DEBUGGER)
211
211
message (FATAL_ERROR "This configuration is not supported. Please build against your system libc to enable the JerryScript debugger." )
212
212
endif ()
213
213
214
- # Sleep function availability check
215
- INCLUDE (CheckIncludeFiles )
216
- CHECK_INCLUDE_FILES (time.h HAVE_TIME_H )
217
- CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H )
218
- if (HAVE_TIME_H )
219
- set (DEFINES_JERRY ${DEFINES_JERRY} HAVE_TIME_H )
220
- elseif (HAVE_UNISTD_H )
221
- set (DEFINES_JERRY ${DEFINES_JERRY} HAVE_UNISTD_H )
222
- endif ()
223
-
224
214
set (DEFINES_JERRY ${DEFINES_JERRY} JERRY_DEBUGGER )
225
215
endif ()
226
216
Original file line number Diff line number Diff line change @@ -261,8 +261,7 @@ jerry_debugger_transport_receive_completed (jerry_debugger_transport_receive_con
261
261
} /* jerry_debugger_transport_receive_completed */
262
262
263
263
/**
264
- * Suspend execution for a given time.
265
- * Note: If the platform does not have nanosleep or usleep, this function does not sleep at all.
264
+ * Suspend execution for a predefined time (JERRY_DEBUGGER_TRANSPORT_TIMEOUT ms).
266
265
*/
267
266
void
268
267
jerry_debugger_transport_sleep (void )
Original file line number Diff line number Diff line change 16
16
#ifndef JRT_H
17
17
#define JRT_H
18
18
19
- #if !defined (_XOPEN_SOURCE ) || _XOPEN_SOURCE < 500
20
- #undef _XOPEN_SOURCE
21
- /* Required macro for sleep functions (nanosleep or usleep) */
22
- #define _XOPEN_SOURCE 500
23
- #endif
24
-
25
19
#include <stdio.h>
26
20
#include <string.h>
27
21
Original file line number Diff line number Diff line change 16
16
#ifndef JEXT_COMMON_H
17
17
#define JEXT_COMMON_H
18
18
19
- #if !defined (_XOPEN_SOURCE ) || _XOPEN_SOURCE < 500
20
- #undef _XOPEN_SOURCE
21
- /* Required macro for sleep functions (nanosleep or usleep) */
22
- #define _XOPEN_SOURCE 500
23
- #endif
24
-
25
19
#include <stdio.h>
26
20
#include <string.h>
27
21
Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ file(GLOB SOURCE_PORT_DEFAULT *.c)
26
26
# (should only be necessary if we used compiler default libc but not checking that)
27
27
set (DEFINES_PORT_DEFAULT _BSD_SOURCE _DEFAULT_SOURCE )
28
28
29
+ # Sleep function availability check
30
+ INCLUDE (CheckIncludeFiles )
31
+ CHECK_INCLUDE_FILES (time.h HAVE_TIME_H )
32
+ CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H )
33
+ if (HAVE_TIME_H )
34
+ set (DEFINES_PORT_DEFAULT ${DEFINES_PORT_DEFAULT} HAVE_TIME_H )
35
+ elseif (HAVE_UNISTD_H )
36
+ set (DEFINES_PORT_DEFAULT ${DEFINES_PORT_DEFAULT} HAVE_UNISTD_H )
37
+ endif ()
38
+
29
39
# Default Jerry port implementation library variants:
30
40
# - default
31
41
# - default-minimal (no extra termination and log APIs)
Original file line number Diff line number Diff line change 13
13
* limitations under the License.
14
14
*/
15
15
16
+ #if !defined (_XOPEN_SOURCE ) || _XOPEN_SOURCE < 500
17
+ #undef _XOPEN_SOURCE
18
+ /* Required macro for sleep functions (nanosleep or usleep) */
19
+ #define _XOPEN_SOURCE 500
20
+ #endif
21
+
16
22
#ifdef HAVE_TIME_H
17
23
#include <time.h>
18
24
#elif defined (HAVE_UNISTD_H )
You can’t perform that action at this time.
0 commit comments