src: fixes for win32

Update following macros:

* NODE_NET_SOCKET_{READ,WRITE}() - they both take 4 arguments,
  not 2

* NODE_COUNT_GC_PERCENTTIME() - it takes a single argument.

Use INT_PTR instead of INT32 in pointer casts in win32_etw provider.

PR-URL: https://github.com/joyent/node/pull/8294
Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Ray Donnelly 2014-08-30 23:51:20 +01:00 committed by Fedor Indutny
parent 011319e248
commit 6f94b3db91
3 changed files with 11 additions and 5 deletions

View File

@ -37,7 +37,7 @@
#define NODE_COUNT_NET_BYTES_SENT(bytes)
#define NODE_COUNT_NET_BYTES_RECV(bytes)
#define NODE_COUNT_GET_GC_RAWTIME()
#define NODE_COUNT_GC_PERCENTTIME()
#define NODE_COUNT_GC_PERCENTTIME(percent)
#define NODE_COUNT_PIPE_BYTES_SENT(bytes)
#define NODE_COUNT_PIPE_BYTES_RECV(bytes)
#endif

View File

@ -25,6 +25,12 @@
#include "node_win32_etw_provider.h"
#include "node_etw_provider.h"
#if defined(_WIN64)
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA
#else
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA
#endif
namespace node {
// From node_win32_etw_provider.cc
@ -92,7 +98,7 @@ extern int events_enabled;
ETW_WRITE_ADDRESS_DATA(descriptors, &context); \
ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \
ETW_WRITE_INT64_DATA(descriptors + 2, &size); \
ETW_WRITE_INT32_DATA(descriptors + 3, &id); \
ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \
ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \
ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \
ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \
@ -241,7 +247,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
}
void* context = NULL;
INT64 size = (INT64)len;
INT32 id = (INT32)addr1;
INT_PTR id = (INT_PTR)addr1;
INT16 flags = 0;
INT16 rangeid = 1;
INT32 col = 1;

View File

@ -92,8 +92,8 @@ INLINE bool NODE_NET_SOCKET_READ_ENABLED();
INLINE bool NODE_NET_SOCKET_WRITE_ENABLED();
INLINE bool NODE_V8SYMBOL_ENABLED();
#define NODE_NET_SOCKET_READ(arg0, arg1)
#define NODE_NET_SOCKET_WRITE(arg0, arg1)
#define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3)
#define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3)
} // namespace node
#endif // SRC_NODE_WIN32_ETW_PROVIDER_H_