λ61
Loading...
Searching...
No Matches
lex61rt.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Tetex7
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19#ifndef LEX61RT_HPP
20#define LEX61RT_HPP
21
22#define LEX61_SYM_LOOKUP_COMPAT extern "C"
23
26
32
33extern int l61_extension_init();
34
35#define LEX61RT_MAKE_HEADER(...) \
36LEX61_SYM_LOOKUP_COMPAT lex61rt::lex61_header_t __lex61_header__ = { \
37 __VA_ARGS__ \
38}
39
41 extern lex61rt::lex61_header_t __lex61_header__; // NOLINT(*-reserved-identifier)
42 extern std::unique_ptr<l61::ExtensionSystem::AbstractExtensionEntryPoint> __lex61_header_ExtensionEntryPoint__; // NOLINT(*-reserved-identifier)
43}
44
45namespace lex61rt
46{
52 template <l61::meta::extensionEntryPointCompatible T>
54 {
56 throw std::logic_error("OOP entry point already set");
57
58 __lex61_header_ExtensionEntryPoint__ = std::make_unique<T>();
59 return 1;
60 }
61} // namespace lex61rt
62
63#define LEX61RT_SET_ENTRY_POINT_CLASS(type) namespace lex61rt { static volatile int __lex61rt_fake_oop_ep_##type##__ = lex61rt::set_oop_entry_point<type>(); }
64
65#endif
#define LEX61_SYM_LOOKUP_COMPAT
Definition lex61rt.hpp:22
int l61_extension_init()
Definition rt_main.cpp:65
std::unique_ptr< l61::ExtensionSystem::AbstractExtensionEntryPoint > __lex61_header_ExtensionEntryPoint__
l61_api_extension_t * l61_api_extension_ptr
Definition ExtensionHeaders.hpp:53
Definition lex61rt.hpp:28
int set_oop_entry_point()
TODO.
Definition lex61rt.hpp:53
l61::ExtensionSystem::l61_api_extension_ptr getApiData()
Definition rt_main.cpp:40
const l61::ExtensionSystem::lex61_header_t lex61_header_t
Definition lex61rt.hpp:29
Definition ExtensionHeaders.hpp:47