Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / xpcom / reflect / xptcall / xptcprivate.h
blob02f408dc3813f69928224197532bb6c3f38dff2b
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* All the xptcall private declarations - only include locally. */
8 #ifndef xptcprivate_h___
9 #define xptcprivate_h___
11 #include "xptcall.h"
12 #include "mozilla/Attributes.h"
14 #if !defined(__ia64) || \
15 (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))
16 # define STUB_ENTRY(n) NS_IMETHOD Stub##n() = 0;
17 #else
18 # define STUB_ENTRY(n) \
19 NS_IMETHOD Stub##n(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \
20 uint64_t, uint64_t, uint64_t) = 0;
21 #endif
23 #define SENTINEL_ENTRY(n) NS_IMETHOD Sentinel##n() = 0;
25 class nsIXPTCStubBase : public nsISupports {
26 public:
27 #include "xptcstubsdef.inc"
30 #undef STUB_ENTRY
31 #undef SENTINEL_ENTRY
33 #if !defined(__ia64) || \
34 (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))
35 # define STUB_ENTRY(n) NS_IMETHOD Stub##n() override;
36 #else
37 # define STUB_ENTRY(n) \
38 NS_IMETHOD Stub##n(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \
39 uint64_t, uint64_t, uint64_t) override;
40 #endif
42 #define SENTINEL_ENTRY(n) NS_IMETHOD Sentinel##n() override;
44 class nsXPTCStubBase final : public nsIXPTCStubBase {
45 public:
46 NS_DECL_ISUPPORTS_INHERITED
48 #include "xptcstubsdef.inc"
50 nsXPTCStubBase(nsIXPTCProxy* aOuter, const nsXPTInterfaceInfo* aEntry)
51 : mOuter(aOuter), mEntry(aEntry) {}
53 nsIXPTCProxy* mOuter;
54 const nsXPTInterfaceInfo* mEntry;
56 ~nsXPTCStubBase() = default;
59 #undef STUB_ENTRY
60 #undef SENTINEL_ENTRY
62 #if defined(__clang__) || defined(__GNUC__)
63 # define ATTRIBUTE_USED __attribute__((__used__))
64 #else
65 # define ATTRIBUTE_USED
66 #endif
68 #endif /* xptcprivate_h___ */