Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: guard nsolid headers with NODE_WANT_INTERNALS #43

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/nsolid/lru_map.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_LRU_MAP_H_
#define SRC_NSOLID_LRU_MAP_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <cassert>
#include <deque>
#include <functional>
Expand Down Expand Up @@ -122,8 +124,9 @@ class LRUMap {
cb_proxy_sig proxy_;
};


} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_LRU_MAP_H_
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_api.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_API_H_
#define SRC_NSOLID_NSOLID_API_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <atomic>
#include <functional>
#include <list>
Expand Down Expand Up @@ -912,4 +914,6 @@ inline uv_loop_t* EnvList::thread_loop() {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_API_H_
5 changes: 3 additions & 2 deletions src/nsolid/nsolid_bindings.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef SRC_NSOLID_NSOLID_BINDINGS_H_
#define SRC_NSOLID_NSOLID_BINDINGS_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node_snapshotable.h"

Expand Down Expand Up @@ -72,9 +73,9 @@ class BindingData : public SnapshotableObject {
static v8::CFunction fast_push_span_data_uint64_;
};



} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_BINDINGS_H_
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_cpu_profiler.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_CPU_PROFILER_H_
#define SRC_NSOLID_NSOLID_CPU_PROFILER_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <map>
#include "nsolid.h"
#include "nsolid/nsolid_util.h"
Expand Down Expand Up @@ -88,4 +90,6 @@ class NSolidCpuProfiler {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_CPU_PROFILER_H_
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_heap_snapshot.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_HEAP_SNAPSHOT_H_
#define SRC_NSOLID_NSOLID_HEAP_SNAPSHOT_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <v8.h>
#include <v8-profiler.h>
#include <nsolid/nsolid_api.h>
Expand Down Expand Up @@ -50,4 +52,6 @@ class NSolidHeapSnapshot {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_HEAP_SNAPSHOT_H_
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_output_stream.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_OUTPUT_STREAM_H_
#define SRC_NSOLID_NSOLID_OUTPUT_STREAM_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <v8.h>
#include <v8-profiler.h>

Expand Down Expand Up @@ -83,4 +85,6 @@ class DataOutputStream : public v8::OutputStream {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_OUTPUT_STREAM_H_
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_trace.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_TRACE_H_
#define SRC_NSOLID_NSOLID_TRACE_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <array>
#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -226,4 +228,6 @@ const Type& SpanPropBase::val() const {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_TRACE_H_
5 changes: 4 additions & 1 deletion src/nsolid/nsolid_util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_NSOLID_UTIL_H_
#define SRC_NSOLID_NSOLID_UTIL_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <algorithm>
#include <array>
#include <chrono> // NOLINT [build/c++11]
Expand Down Expand Up @@ -191,9 +193,10 @@ class ring_buffer {
std::vector<double> buffer_;
};


} // namespace utils
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_NSOLID_UTIL_H_
4 changes: 4 additions & 0 deletions src/nsolid/spinlock.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_SPINLOCK_H_
#define SRC_NSOLID_SPINLOCK_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <atomic>

namespace node {
Expand Down Expand Up @@ -42,4 +44,6 @@ class Spinlock {
} // namespace nsolid
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_SPINLOCK_H_
4 changes: 4 additions & 0 deletions src/nsolid/thread_safe.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SRC_NSOLID_THREAD_SAFE_H_
#define SRC_NSOLID_THREAD_SAFE_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "spinlock.h"
#include "../../deps/nsuv/include/nsuv-inl.h"

Expand Down Expand Up @@ -195,4 +197,6 @@ struct TSList<DataType*> {

#undef NSOLID_WUR

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NSOLID_THREAD_SAFE_H_
1 change: 1 addition & 0 deletions test/addons/nsolid-agent-id/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-config-hooks/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-dispatchqueue/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-env-hooks/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-eventloop-cmd/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-exit/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-proc-metrics/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-queue-cb/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
1 change: 1 addition & 0 deletions test/addons/nsolid-run-command/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
'defines': [ 'NODE_WANT_INTERNALS=1' ],
}
]
}
Loading