Skip to content

Commit 924d29e

Browse files
tniessentargos
authored andcommitted
src: add and fix some preprocessor comments
PR-URL: #40701 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 80ce97f commit 924d29e

13 files changed

+17
-16
lines changed

src/allocated_buffer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ struct AllocatedBuffer {
6868

6969
} // namespace node
7070

71-
#endif // NODE_WANT_INTERNALS
71+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
7272

7373
#endif // SRC_ALLOCATED_BUFFER_H_

src/api/exceptions.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
237237

238238
return e;
239239
}
240-
#endif
240+
#endif // _WIN32
241241

242242
// Implement the legacy name exposed in node.h. This has not been in fact
243243
// fatal any more, as the user can handle the exception in the

src/crypto/crypto_tls.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ unsigned int TLSWrap::PskClientCallback(
14741474
return psk_buf.length();
14751475
}
14761476

1477-
#endif
1477+
#endif // ifndef OPENSSL_NO_PSK
14781478

14791479
void TLSWrap::GetWriteQueueSize(const FunctionCallbackInfo<Value>& info) {
14801480
TLSWrap* wrap;

src/node.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
960960
}
961961
# endif
962962

963-
#endif
963+
#endif // defined(NODE_HAVE_I18N_SUPPORT)
964964

965965
NativeModuleEnv::InitializeCodeCache();
966966

@@ -1091,7 +1091,7 @@ InitializationResult InitializeOncePerProcess(
10911091
return result;
10921092
}
10931093
}
1094-
#else
1094+
#else // OPENSSL_VERSION_MAJOR < 3
10951095
if (FIPS_mode()) {
10961096
OPENSSL_init();
10971097
}

src/node_internals.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ThreadPoolWork {
283283

284284
#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
285285
#define NODE_IMPLEMENTS_POSIX_CREDENTIALS 1
286-
#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
286+
#endif // defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
287287

288288
namespace credentials {
289289
bool SafeGetenv(const char* key, std::string* text, Environment* env = nullptr);

src/node_native_module.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void NativeModuleLoader::InitializeModuleCategories() {
9090

9191
#if !NODE_USE_V8_PLATFORM || !defined(NODE_HAVE_I18N_SUPPORT)
9292
"trace_events",
93-
#endif // !NODE_USE_V8_PLATFORM
93+
#endif // !NODE_USE_V8_PLATFORM || !defined(NODE_HAVE_I18N_SUPPORT)
9494

9595
#if !HAVE_OPENSSL
9696
"crypto",

src/node_options.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) {
8383
if ((secure_heap_min & (secure_heap_min - 1)) != 0)
8484
errors->push_back("--secure-heap-min must be a power of 2");
8585
}
86-
#endif
86+
#endif // HAVE_OPENSSL
87+
8788
if (use_largepages != "off" &&
8889
use_largepages != "on" &&
8990
use_largepages != "silent") {
@@ -816,7 +817,7 @@ PerProcessOptionsParser::PerProcessOptionsParser(
816817
"minimum allocation size from the OpenSSL secure heap",
817818
&PerProcessOptions::secure_heap_min,
818819
kAllowedInEnvironment);
819-
#endif
820+
#endif // HAVE_OPENSSL
820821
#if OPENSSL_VERSION_MAJOR >= 3
821822
AddOption("--openssl-legacy-provider",
822823
"enable OpenSSL 3.0 legacy provider",

src/node_report.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ static void PrintResourceUsage(JSONWriter* writer) {
687687
writer->json_objectend();
688688
writer->json_objectend();
689689
}
690-
#endif
690+
#endif // RUSAGE_THREAD
691691
}
692692

693693
// Report operating system information.

src/node_sockaddr-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,5 +262,5 @@ v8::MaybeLocal<v8::Value> SocketAddressBlockList::Rule::ToV8String(
262262
}
263263
} // namespace node
264264

265-
#endif // NODE_WANT_INTERNALS
265+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
266266
#endif // SRC_NODE_SOCKADDR_INL_H_

src/node_sockaddr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,6 @@ class SocketAddressBlockListWrap : public BaseObject {
400400

401401
} // namespace node
402402

403-
#endif // NOE_WANT_INTERNALS
403+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
404404

405405
#endif // SRC_NODE_SOCKADDR_H_

src/node_url.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ bool ToASCII(const std::string& input, std::string* output) {
331331
output->assign(*buf, buf.length());
332332
return true;
333333
}
334-
#else
334+
#else // !defined(NODE_HAVE_I18N_SUPPORT)
335335
// Intentional non-ops if ICU is not present.
336336
bool ToUnicode(const std::string& input, std::string* output) {
337337
*output = input;
@@ -342,7 +342,7 @@ bool ToASCII(const std::string& input, std::string* output) {
342342
*output = input;
343343
return true;
344344
}
345-
#endif
345+
#endif // !defined(NODE_HAVE_I18N_SUPPORT)
346346

347347
#define NS_IN6ADDRSZ 16
348348

src/node_worker.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
497497
return;
498498
}
499499
}
500-
#endif
500+
#endif // NODE_WITHOUT_NODE_OPTIONS
501501
}
502502

503503
if (args[2]->IsArray()) {

src/stream_pipe.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ class StreamPipe : public AsyncWrap {
7272

7373
} // namespace node
7474

75-
#endif
75+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
7676

7777
#endif // SRC_STREAM_PIPE_H_

0 commit comments

Comments
 (0)