@@ -88,7 +88,10 @@ constexpr char kPathSeparator = '/';
8888const char * const kPathSeparator = " \\ /" ;
8989#endif
9090
91- #define GET_OFFSET (a ) (IsSafeJsInt(a) ? (a).As<Integer>()->Value () : -1)
91+ inline int64_t GetOffset (Local<Value> value) {
92+ return IsSafeJsInt (value) ? value.As <Integer>()->Value () : -1 ;
93+ }
94+
9295#define TRACE_NAME (name ) " fs.sync." #name
9396#define GET_TRACE_ENABLED \
9497 (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \
@@ -1681,7 +1684,7 @@ static void WriteBuffer(const FunctionCallbackInfo<Value>& args) {
16811684 CHECK_LE (len, buffer_length);
16821685 CHECK_GE (off + len, off);
16831686
1684- const int64_t pos = GET_OFFSET (args[4 ]);
1687+ const int64_t pos = GetOffset (args[4 ]);
16851688
16861689 char * buf = buffer_data + off;
16871690 uv_buf_t uvbuf = uv_buf_init (buf, len);
@@ -1721,7 +1724,7 @@ static void WriteBuffers(const FunctionCallbackInfo<Value>& args) {
17211724 CHECK (args[1 ]->IsArray ());
17221725 Local<Array> chunks = args[1 ].As <Array>();
17231726
1724- int64_t pos = GET_OFFSET (args[2 ]);
1727+ int64_t pos = GetOffset (args[2 ]);
17251728
17261729 MaybeStackBuffer<uv_buf_t > iovs (chunks->Length ());
17271730
@@ -1765,7 +1768,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
17651768 CHECK (args[0 ]->IsInt32 ());
17661769 const int fd = args[0 ].As <Int32>()->Value ();
17671770
1768- const int64_t pos = GET_OFFSET (args[2 ]);
1771+ const int64_t pos = GetOffset (args[2 ]);
17691772
17701773 const auto enc = ParseEncoding (isolate, args[3 ], UTF8);
17711774
0 commit comments