Skip to content

Commit 3ce4dce

Browse files
authored
Use _WIN32 instead WIN32. (#4484)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
1 parent fe3b0a8 commit 3ce4dce

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

jerry-core/ecma/base/ecma-helpers-number.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ ecma_number_is_finite (ecma_number_t num) /**< ecma-number */
342342
{
343343
#if defined (__GNUC__) || defined (__clang__)
344344
return __builtin_isfinite (num);
345-
#elif defined (WIN32)
345+
#elif defined (_WIN32)
346346
return isfinite (num);
347347
#else
348348
return !ecma_number_is_nan (num) && !ecma_number_is_infinity (num);

jerry-core/ecma/builtin-objects/ecma-builtin-math.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "jrt.h"
2929
#include "jrt-libc-includes.h"
3030

31-
#if defined (WIN32)
31+
#if defined (_WIN32)
3232
#include <intrin.h>
3333
#endif
3434

@@ -553,7 +553,7 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
553553
uint32_t n = ecma_number_to_uint32 (x);
554554
#if defined (__GNUC__) || defined (__clang__)
555555
x = n ? __builtin_clz (n) : 32;
556-
#elif defined (WIN32)
556+
#elif defined (_WIN32)
557557
unsigned long ret;
558558
x = _BitScanReverse (&ret, n) ? 31 - ret : 32;
559559
#else

jerry-ext/debugger/debugger-serial.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "jerryscript-ext/debugger.h"
1818
#include "jext-common.h"
1919

20-
#if (defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) && !defined WIN32
20+
#if (defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) && !defined _WIN32
2121

2222
#include <errno.h>
2323
#include <fcntl.h>
@@ -393,7 +393,7 @@ jerryx_debugger_serial_create (const char *config) /**< specify the configuratio
393393
return true;
394394
} /* jerryx_debugger_serial_create */
395395

396-
#else /* !(defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) || WIN32 */
396+
#else /* !(defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) || _WIN32 */
397397
/**
398398
* Dummy function when debugger is disabled.
399399
*
@@ -406,4 +406,4 @@ jerryx_debugger_serial_create (const char *config)
406406
return false;
407407
} /* jerryx_debugger_serial_create */
408408

409-
#endif /* (defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) && !defined WIN32 */
409+
#endif /* (defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1)) && !defined _WIN32 */

jerry-ext/debugger/debugger-tcp.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <errno.h>
2323

24-
#ifdef WIN32
24+
#ifdef _WIN32
2525
#include <BaseTsd.h>
2626
typedef SSIZE_T ssize_t;
2727
#include <WS2tcpip.h>
@@ -36,7 +36,7 @@ typedef SSIZE_T ssize_t;
3636
/* On Windows sockets have a SOCKET typedef */
3737
typedef SOCKET jerryx_socket;
3838

39-
#else /* !WIN32 */
39+
#else /* !_WIN32 */
4040

4141
#include <arpa/inet.h>
4242
#include <fcntl.h>
@@ -51,7 +51,7 @@ typedef SOCKET jerryx_socket;
5151

5252
/* On *nix the sockets are integer identifiers */
5353
typedef int jerryx_socket;
54-
#endif /* WIN32 */
54+
#endif /* _WIN32 */
5555

5656
/**
5757
* Implementation of transport over tcp/ip.
@@ -74,11 +74,11 @@ typedef struct
7474
static inline int
7575
jerryx_debugger_tcp_get_errno (void)
7676
{
77-
#ifdef WIN32
77+
#ifdef _WIN32
7878
return WSAGetLastError ();
79-
#else /* !WIN32 */
79+
#else /* !_WIN32 */
8080
return errno;
81-
#endif /* WIN32 */
81+
#endif /* _WIN32 */
8282
} /* jerryx_debugger_tcp_get_errno */
8383

8484
/**
@@ -87,11 +87,11 @@ jerryx_debugger_tcp_get_errno (void)
8787
static inline void
8888
jerryx_debugger_tcp_close_socket (jerryx_socket socket_id) /**< socket to close */
8989
{
90-
#ifdef WIN32
90+
#ifdef _WIN32
9191
closesocket (socket_id);
92-
#else /* !WIN32 */
92+
#else /* !_WIN32 */
9393
close (socket_id);
94-
#endif /* WIN32 */
94+
#endif /* _WIN32 */
9595
} /* jerryx_debugger_tcp_close_socket */
9696

9797
/**
@@ -105,7 +105,7 @@ jerryx_debugger_tcp_log_error (int errno_value) /**< error value to log */
105105
return;
106106
}
107107

108-
#ifdef WIN32
108+
#ifdef _WIN32
109109
char *error_message = NULL;
110110
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
111111
NULL,
@@ -116,9 +116,9 @@ jerryx_debugger_tcp_log_error (int errno_value) /**< error value to log */
116116
NULL);
117117
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "TCP Error: %s\n", error_message);
118118
LocalFree (error_message);
119-
#else /* !WIN32 */
119+
#else /* !_WIN32 */
120120
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "TCP Error: %s\n", strerror (errno_value));
121-
#endif /* WIN32 */
121+
#endif /* _WIN32 */
122122
} /* jerryx_debugger_tcp_log_error */
123123

124124
/**
@@ -279,15 +279,15 @@ jerryx_debugger_tcp_configure_socket (jerryx_socket server_socket, /** < socket
279279
bool
280280
jerryx_debugger_tcp_create (uint16_t port) /**< listening port */
281281
{
282-
#ifdef WIN32
282+
#ifdef _WIN32
283283
WSADATA wsaData;
284284
int wsa_init_status = WSAStartup (MAKEWORD (2, 2), &wsaData);
285285
if (wsa_init_status != NO_ERROR)
286286
{
287287
JERRYX_ERROR_MSG ("WSA Error: %d\n", wsa_init_status);
288288
return false;
289289
}
290-
#endif /* WIN32*/
290+
#endif /* _WIN32*/
291291

292292
jerryx_socket server_socket = socket (AF_INET, SOCK_STREAM, 0);
293293
if (server_socket == JERRYX_SOCKET_INVALID)
@@ -320,14 +320,14 @@ jerryx_debugger_tcp_create (uint16_t port) /**< listening port */
320320
}
321321

322322
/* Set non-blocking mode. */
323-
#ifdef WIN32
323+
#ifdef _WIN32
324324
u_long nonblocking_enabled = 1;
325325
if (ioctlsocket (tcp_socket, FIONBIO, &nonblocking_enabled) != NO_ERROR)
326326
{
327327
jerryx_debugger_tcp_close_socket (tcp_socket);
328328
return false;
329329
}
330-
#else /* !WIN32 */
330+
#else /* !_WIN32 */
331331
int socket_flags = fcntl (tcp_socket, F_GETFL, 0);
332332

333333
if (socket_flags < 0)
@@ -341,7 +341,7 @@ jerryx_debugger_tcp_create (uint16_t port) /**< listening port */
341341
close (tcp_socket);
342342
return false;
343343
}
344-
#endif /* WIN32 */
344+
#endif /* _WIN32 */
345345

346346
JERRYX_DEBUG_MSG ("Connected from: %s\n", inet_ntoa (addr.sin_addr));
347347

jerry-port/default/default-debugger.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#define _XOPEN_SOURCE 500
2020
#endif
2121

22-
#ifdef WIN32
22+
#ifdef _WIN32
2323
#include <windows.h>
2424
#elif defined (HAVE_TIME_H)
2525
#include <time.h>
2626
#elif defined (HAVE_UNISTD_H)
2727
#include <unistd.h>
28-
#endif /* WIN32 */
28+
#endif /* _WIN32 */
2929

3030
#include "jerryscript-port.h"
3131
#include "jerryscript-port-default.h"
@@ -36,7 +36,7 @@
3636
*/
3737
void jerry_port_sleep (uint32_t sleep_time) /**< milliseconds to sleep */
3838
{
39-
#ifdef WIN32
39+
#ifdef _WIN32
4040
Sleep (sleep_time);
4141
#elif defined (HAVE_TIME_H)
4242
struct timespec sleep_timespec;

jerry-port/default/default-module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* limitations under the License.
1414
*/
1515

16-
#if !defined (WIN32)
16+
#if !defined (_WIN32)
1717
#include <libgen.h>
18-
#endif /* !defined (WIN32) */
18+
#endif /* !defined (_WIN32) */
1919
#include <limits.h>
2020
#include <stdarg.h>
2121
#include <stdlib.h>
@@ -116,7 +116,7 @@ jerry_port_normalize_path (const char *in_path_p, /**< input file path */
116116
{
117117
size_t ret = 0;
118118

119-
#if defined (WIN32)
119+
#if defined (_WIN32)
120120
size_t base_drive_dir_len;
121121
const size_t in_path_len = strnlen (in_path_p, _MAX_PATH);
122122
char *path_p;

0 commit comments

Comments
 (0)