接续上一轮:推进浏览器验证与M428配置收拢
结论:已完成浏览器侧真实加载验证,M428/M429/M430 的配置入口进一步从 LinuxCNC INI/HALFILE/REMAP 来源生成,native 与 source-link 验证通过。
This commit is contained in:
18
core/wasm_shims/boost/noncopyable.hpp
Normal file
18
core/wasm_shims/boost/noncopyable.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef CNC_SIM_WASM_SHIMS_BOOST_NONCOPYABLE_HPP
|
||||
#define CNC_SIM_WASM_SHIMS_BOOST_NONCOPYABLE_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
class noncopyable {
|
||||
protected:
|
||||
noncopyable() = default;
|
||||
~noncopyable() = default;
|
||||
|
||||
private:
|
||||
noncopyable(const noncopyable &) = delete;
|
||||
noncopyable &operator=(const noncopyable &) = delete;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // CNC_SIM_WASM_SHIMS_BOOST_NONCOPYABLE_HPP
|
||||
10
core/wasm_shims/boost/python/class.hpp
Normal file
10
core/wasm_shims/boost/python/class.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/call_traits.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_DEDUCED_TYPENAME
|
||||
#define BOOST_DEDUCED_TYPENAME typename
|
||||
#endif
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
3
core/wasm_shims/boost/python/converter/registry.hpp
Normal file
3
core/wasm_shims/boost/python/converter/registry.hpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
13
core/wasm_shims/boost/python/def.hpp
Normal file
13
core/wasm_shims/boost/python/def.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
template <typename... Args>
|
||||
void def(Args &&...) {
|
||||
}
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
3
core/wasm_shims/boost/python/detail/caller.hpp
Normal file
3
core/wasm_shims/boost/python/detail/caller.hpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
25
core/wasm_shims/boost/python/enum.hpp
Normal file
25
core/wasm_shims/boost/python/enum.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
template <typename T>
|
||||
class enum_ {
|
||||
public:
|
||||
explicit enum_(const char *) {
|
||||
}
|
||||
|
||||
template <typename Value>
|
||||
enum_ &value(const char *, Value) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
enum_ &export_values() {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
13
core/wasm_shims/boost/python/exception_translator.hpp
Normal file
13
core/wasm_shims/boost/python/exception_translator.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
template <typename Exception, typename Translator>
|
||||
void register_exception_translator(Translator) {
|
||||
}
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
5
core/wasm_shims/boost/python/module.hpp
Normal file
5
core/wasm_shims/boost/python/module.hpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
#define BOOST_PYTHON_MODULE(name) extern "C" void init_##name()
|
||||
@@ -1,24 +1,126 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdarg>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include "boost/noncopyable.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
using Py_ssize_t = std::ptrdiff_t;
|
||||
struct _object;
|
||||
using PyObject = _object;
|
||||
|
||||
struct _typeobject {
|
||||
const char *tp_name;
|
||||
std::size_t tp_basicsize;
|
||||
std::size_t tp_itemsize;
|
||||
void *tp_dealloc;
|
||||
void *tp_print;
|
||||
void *tp_getattr;
|
||||
void *tp_setattr;
|
||||
void *tp_compare;
|
||||
void *tp_repr;
|
||||
void *tp_as_number;
|
||||
void *tp_as_sequence;
|
||||
void *tp_as_mapping;
|
||||
void *tp_hash;
|
||||
void *tp_call;
|
||||
void *tp_str;
|
||||
void *tp_getattro;
|
||||
void *tp_setattro;
|
||||
void *tp_as_buffer;
|
||||
unsigned long tp_flags;
|
||||
const char *tp_doc;
|
||||
void *tp_traverse;
|
||||
void *tp_clear;
|
||||
void *tp_richcompare;
|
||||
Py_ssize_t tp_weaklistoffset;
|
||||
void *tp_iter;
|
||||
void *tp_iternext;
|
||||
void *tp_methods;
|
||||
void *tp_members;
|
||||
void *tp_getset;
|
||||
struct _typeobject *tp_base;
|
||||
void *tp_dict;
|
||||
void *tp_descr_get;
|
||||
void *tp_descr_set;
|
||||
Py_ssize_t tp_dictoffset;
|
||||
void *tp_init;
|
||||
void *tp_alloc;
|
||||
PyObject *(*tp_new)(struct _typeobject *, PyObject *, PyObject *);
|
||||
void *tp_free;
|
||||
void *tp_is_gc;
|
||||
void *tp_bases;
|
||||
void *tp_mro;
|
||||
void *tp_cache;
|
||||
void *tp_subclasses;
|
||||
void *tp_weaklink;
|
||||
void *tp_del;
|
||||
unsigned int tp_version_tag;
|
||||
void *tp_finalize;
|
||||
#if PY_VERSION_HEX >= 0x030800f0
|
||||
void *tp_vectorcall;
|
||||
#if PY_VERSION_HEX >= 0x030c00f0
|
||||
void *tp_watched;
|
||||
#if PY_VERSION_HEX >= 0x030d00f0
|
||||
void *tp_versions_used;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
using PyTypeObject = _typeobject;
|
||||
|
||||
struct _object {
|
||||
PyTypeObject *ob_type;
|
||||
};
|
||||
using PyObject = _object;
|
||||
|
||||
struct _inittab {
|
||||
const char *name;
|
||||
PyObject *(*initfunc)(void);
|
||||
};
|
||||
|
||||
using PyCFunction = PyObject *(*)(PyObject *, PyObject *);
|
||||
using getter = PyObject *(*)(PyObject *, void *);
|
||||
using setter = int (*)(PyObject *, PyObject *, void *);
|
||||
|
||||
struct PyGetSetDef {
|
||||
char *name;
|
||||
getter get;
|
||||
setter set;
|
||||
char *doc;
|
||||
void *closure;
|
||||
};
|
||||
|
||||
struct PyMemberDef {
|
||||
char *name;
|
||||
int type;
|
||||
Py_ssize_t offset;
|
||||
int flags;
|
||||
char *doc;
|
||||
};
|
||||
|
||||
struct PyMethodDef {
|
||||
const char *ml_name;
|
||||
PyCFunction ml_meth;
|
||||
int ml_flags;
|
||||
const char *ml_doc;
|
||||
};
|
||||
|
||||
struct PyModuleDef {
|
||||
void *m_base;
|
||||
const char *m_name;
|
||||
const char *m_doc;
|
||||
Py_ssize_t m_size;
|
||||
PyMethodDef *m_methods;
|
||||
void *m_slots;
|
||||
void *m_traverse;
|
||||
void *m_clear;
|
||||
void *m_free;
|
||||
};
|
||||
|
||||
int Py_IsInitialized(void);
|
||||
PyObject *PyErr_Occurred(void);
|
||||
void PyErr_Clear(void);
|
||||
@@ -31,21 +133,66 @@ int PyUnicode_Check(PyObject *);
|
||||
int PyLong_Check(PyObject *);
|
||||
int PyFloat_Check(PyObject *);
|
||||
int PyGen_Check(PyObject *);
|
||||
int PyObject_IsInstance(PyObject *, PyObject *);
|
||||
PyObject *PyObject_Str(PyObject *);
|
||||
const char *PyUnicode_AsUTF8(PyObject *);
|
||||
PyObject *PyUnicode_FromString(const char *);
|
||||
void PyErr_SetObject(PyObject *, PyObject *);
|
||||
PyObject *PyErr_Format(PyObject *, const char *, ...);
|
||||
void Py_DecRef(PyObject *);
|
||||
int PyArg_ParseTuple(PyObject *, const char *, ...);
|
||||
int PyArg_VaParse(PyObject *, const char *, va_list);
|
||||
PyObject *PyObject_CallMethod(PyObject *, char *, char *, ...);
|
||||
PyObject *PyObject_GetAttrString(PyObject *, const char *);
|
||||
int PyObject_SetAttrString(PyObject *, const char *, PyObject *);
|
||||
int PyObject_IsTrue(PyObject *);
|
||||
PyObject *PyLong_FromLong(long);
|
||||
long PyLong_AsLong(PyObject *);
|
||||
double PyFloat_AsDouble(PyObject *);
|
||||
PyObject *PyTuple_New(Py_ssize_t);
|
||||
PyObject *PyTuple_GetItem(PyObject *, Py_ssize_t);
|
||||
Py_ssize_t PyTuple_Size(PyObject *);
|
||||
int PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
|
||||
PyObject *PyList_New(Py_ssize_t);
|
||||
PyObject *PyList_GetItem(PyObject *, Py_ssize_t);
|
||||
Py_ssize_t PyList_Size(PyObject *);
|
||||
int PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
|
||||
PyObject *PySequence_GetItem(PyObject *, Py_ssize_t);
|
||||
Py_ssize_t PySequence_Length(PyObject *);
|
||||
PyObject *Py_BuildValue(const char *, ...);
|
||||
PyObject *PyModule_Create(PyModuleDef *);
|
||||
int PyModule_AddObject(PyObject *, const char *, PyObject *);
|
||||
int PyType_Ready(PyTypeObject *);
|
||||
PyObject *PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *);
|
||||
void *PyObject_NewShim(std::size_t, PyTypeObject *);
|
||||
extern PyObject *PyExc_KeyError;
|
||||
extern PyObject *PyExc_KeyboardInterrupt;
|
||||
extern PyObject *PyExc_RuntimeError;
|
||||
extern PyObject *PyExc_StopIteration;
|
||||
extern PyObject *PyExc_TypeError;
|
||||
extern PyObject *_Py_NoneStructPtr;
|
||||
extern PyTypeObject PyString_Type;
|
||||
extern PyTypeObject PyInt_Type;
|
||||
extern PyTypeObject PyList_Type;
|
||||
|
||||
#define PyObject_HEAD PyObject ob_base;
|
||||
#define PyVarObject_HEAD_INIT(type, size)
|
||||
#define PyModuleDef_HEAD_INIT nullptr
|
||||
#define Py_TPFLAGS_DEFAULT 0
|
||||
#define PyMODINIT_FUNC extern "C" PyObject *
|
||||
#define METH_VARARGS 0x0001
|
||||
#define Py_None (_Py_NoneStructPtr)
|
||||
#define Py_TYPE(ob) ((ob)->ob_type)
|
||||
#define Py_DECREF(ob) Py_DecRef(reinterpret_cast<PyObject *>(ob))
|
||||
#define Py_XDECREF(ob) \
|
||||
do { \
|
||||
if (ob) { \
|
||||
Py_DecRef(ob); \
|
||||
Py_DecRef(reinterpret_cast<PyObject *>(ob)); \
|
||||
} \
|
||||
} while (0)
|
||||
#define PyTuple_SET_ITEM(op, i, v) PyTuple_SetItem((op), (i), (v))
|
||||
#define PyList_SET_ITEM(op, i, v) PyList_SetItem((op), (i), (v))
|
||||
#define PyObject_New(type, typeobj) reinterpret_cast<type *>(PyObject_NewShim(sizeof(type), (typeobj)))
|
||||
|
||||
}
|
||||
|
||||
@@ -106,6 +253,93 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct no_init_t {};
|
||||
inline constexpr no_init_t no_init{};
|
||||
|
||||
struct default_call_policies {};
|
||||
struct reference_existing_object {};
|
||||
|
||||
template <typename T>
|
||||
struct return_value_policy {
|
||||
};
|
||||
|
||||
template <int, int>
|
||||
struct with_custodian_and_ward_postcall {
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
struct init {
|
||||
};
|
||||
|
||||
class arg {
|
||||
public:
|
||||
explicit arg(const char *) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T = void>
|
||||
struct type_info {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
type_info<T> type_id() {
|
||||
return {};
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
object make_getter(Args &&...) {
|
||||
return {};
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
object make_setter(Args &&...) {
|
||||
return {};
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
object make_function(Args &&...) {
|
||||
return {};
|
||||
}
|
||||
|
||||
template <typename T, typename Bases = void>
|
||||
class class_ {
|
||||
public:
|
||||
explicit class_(const char *) {
|
||||
}
|
||||
|
||||
class_(const char *, no_init_t) {
|
||||
}
|
||||
|
||||
class_(const char *, const char *) {
|
||||
}
|
||||
|
||||
class_(const char *, const char *, no_init_t) {
|
||||
}
|
||||
|
||||
template <typename Arg>
|
||||
class_(const char *, Arg) {
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
class_ &def(Args &&...) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
class_ &def_readwrite(Args &&...) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
class_ &add_property(Args &&...) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
PyObject *ptr() const {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
inline object getattr(const object &, const char *) {
|
||||
return {};
|
||||
}
|
||||
@@ -115,6 +349,10 @@ public:
|
||||
template <typename T>
|
||||
void append(const T &) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void extend(const T &) {
|
||||
}
|
||||
};
|
||||
|
||||
class dict : public object {
|
||||
@@ -131,8 +369,35 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
tuple make_tuple(Args &&...) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline object operator%(const char *, const tuple &) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline object operator%(const object &, const tuple &) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline object operator+(const object &, const object &) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline object operator+(const object &, const char *) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline object operator+(const char *, const object &) {
|
||||
return {};
|
||||
}
|
||||
|
||||
class scope {
|
||||
public:
|
||||
scope() = default;
|
||||
|
||||
explicit scope(const object &) {
|
||||
}
|
||||
|
||||
@@ -187,6 +452,8 @@ allow_null_result<T> allow_null(T *value) {
|
||||
template <typename T = void>
|
||||
class handle {
|
||||
public:
|
||||
handle() = default;
|
||||
|
||||
template <typename U>
|
||||
explicit handle(const U &) {
|
||||
}
|
||||
@@ -194,6 +461,10 @@ public:
|
||||
explicit operator bool() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void *get() const {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class str : public object {
|
||||
|
||||
16
core/wasm_shims/boost/python/object/class_detail.hpp
Normal file
16
core/wasm_shims/boost/python/object/class_detail.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
namespace objects {
|
||||
|
||||
template <typename T>
|
||||
void *registered_class_object(T) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace objects
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
13
core/wasm_shims/boost/python/return_internal_reference.hpp
Normal file
13
core/wasm_shims/boost/python/return_internal_reference.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "boost/python/object.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
template <int Owner = 1, typename BasePolicy = default_call_policies>
|
||||
struct return_internal_reference : BasePolicy {
|
||||
};
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
template <typename Map>
|
||||
class map_indexing_suite {
|
||||
};
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
Reference in New Issue
Block a user