electron/atom/common/node_includes.h

89 lines
2.3 KiB
C
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_COMMON_NODE_INCLUDES_H_
#define ATOM_COMMON_NODE_INCLUDES_H_
#include "base/logging.h"
// Include common headers for using node APIs.
2018-07-11 17:43:52 +00:00
#ifdef NODE_SHARED_MODE
2015-04-01 13:33:08 +00:00
#define BUILDING_NODE_EXTENSION
2018-07-11 17:43:52 +00:00
#endif
2015-04-01 13:33:08 +00:00
// The following define makes sure that we do not include the macros
// again. But we still need the tracing functions, so declaring them.
#define SRC_TRACING_TRACE_EVENT_H_
#pragma push_macro("ASSERT")
#pragma push_macro("CHECK")
#pragma push_macro("CHECK_EQ")
#pragma push_macro("CHECK_GE")
#pragma push_macro("CHECK_GT")
#pragma push_macro("CHECK_LE")
#pragma push_macro("CHECK_LT")
#pragma push_macro("CHECK_NE")
#pragma push_macro("DISALLOW_COPY_AND_ASSIGN")
#pragma push_macro("LIKELY")
#pragma push_macro("NO_RETURN")
#pragma push_macro("UNLIKELY")
2015-01-07 04:53:06 +00:00
#undef ASSERT
#undef CHECK
2014-01-10 10:24:44 +00:00
#undef CHECK_EQ
2014-06-28 11:31:23 +00:00
#undef CHECK_GE
#undef CHECK_GT
#undef CHECK_LE
#undef CHECK_LT
#undef CHECK_NE
#undef DISALLOW_COPY_AND_ASSIGN
2017-01-23 06:53:29 +00:00
#undef LIKELY
#undef NO_RETURN
#undef UNLIKELY
#undef debug_string // This is defined in macOS SDK in AssertMacros.h.
#undef require_string // This is defined in macOS SDK in AssertMacros.h.
#include "env-inl.h"
#include "env.h"
#include "node.h"
#include "node_buffer.h"
#include "node_internals.h"
2018-09-18 00:48:10 +00:00
#include "node_options.h"
#include "node_platform.h"
// Alternative to NODE_MODULE_CONTEXT_AWARE_X.
// Allows to explicitly register builtin modules instead of using
// __attribute__((constructor)).
#define NODE_LINKED_MODULE_CONTEXT_AWARE(modname, regfunc) \
NODE_MODULE_CONTEXT_AWARE_CPP(modname, regfunc, nullptr, NM_F_LINKED)
#pragma pop_macro("ASSERT")
#pragma pop_macro("CHECK")
#pragma pop_macro("CHECK_EQ")
#pragma pop_macro("CHECK_GE")
#pragma pop_macro("CHECK_GT")
#pragma pop_macro("CHECK_LE")
#pragma pop_macro("CHECK_LT")
#pragma pop_macro("CHECK_NE")
#pragma pop_macro("DISALLOW_COPY_AND_ASSIGN")
#pragma pop_macro("LIKELY")
#pragma pop_macro("NO_RETURN")
#pragma pop_macro("UNLIKELY")
namespace node {
namespace tracing {
class TraceEventHelper {
public:
static v8::TracingController* GetTracingController();
static node::tracing::Agent* GetAgent();
static void SetAgent(node::tracing::Agent* agent);
};
} // namespace tracing
} // namespace node
#endif // ATOM_COMMON_NODE_INCLUDES_H_