继续把 interp_execute.cc、interp_queue.cc、interp_find.cc 等 LinuxCNC 源文件纳入直接编译/链接路径,逐步删除临时 convert_g() wrapper 行为
结论:已将核心 LinuxCNC interpreter 源接入 standalone native 编译链接路径,移除 minimal runtime 中的手写 convert_g 行为,并通过 native probe 验证。
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
struct _object;
|
||||
typedef _object PyObject;
|
||||
9
wasm-port/runtime/core/shims/boost/python/object_fwd.hpp
Normal file
9
wasm-port/runtime/core/shims/boost/python/object_fwd.hpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
namespace boost {
|
||||
namespace python {
|
||||
|
||||
class object {};
|
||||
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
3
wasm-port/runtime/core/shims/config.h
Normal file
3
wasm-port/runtime/core/shims/config.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define PACKAGE_VERSION "2.10.0~pre1"
|
||||
7
wasm-port/runtime/core/shims/fmt/format.h
Normal file
7
wasm-port/runtime/core/shims/fmt/format.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <format>
|
||||
|
||||
namespace fmt {
|
||||
using std::format;
|
||||
}
|
||||
18
wasm-port/runtime/core/shims/nml_intf/emc.hh
Normal file
18
wasm-port/runtime/core/shims/nml_intf/emc.hh
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
// Minimal shim for standalone interpreter source probes.
|
||||
enum EmcJointType : int {
|
||||
EMC_LINEAR = 1,
|
||||
EMC_ANGULAR = 2,
|
||||
};
|
||||
|
||||
class EMC_STAT {
|
||||
public:
|
||||
struct Motion {
|
||||
struct Traj {
|
||||
double linearUnits = 1.0;
|
||||
} traj;
|
||||
} motion;
|
||||
};
|
||||
|
||||
extern EMC_STAT *emcStatus;
|
||||
13
wasm-port/runtime/core/shims/pythonplugin/python_plugin.hh
Normal file
13
wasm-port/runtime/core/shims/pythonplugin/python_plugin.hh
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
class PythonPlugin {
|
||||
public:
|
||||
bool usable() const { return false; }
|
||||
int plugin_status() const { return 0; }
|
||||
const std::string &last_exception() const {
|
||||
static std::string empty;
|
||||
return empty;
|
||||
}
|
||||
};
|
||||
67
wasm-port/runtime/core/shims/rtapi.h
Normal file
67
wasm-port/runtime/core/shims/rtapi.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
|
||||
#ifndef RTAPI_BEGIN_DECLS
|
||||
#ifdef __cplusplus
|
||||
#define RTAPI_BEGIN_DECLS extern "C" {
|
||||
#define RTAPI_END_DECLS }
|
||||
#else
|
||||
#define RTAPI_BEGIN_DECLS
|
||||
#define RTAPI_END_DECLS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef RTAPI_NAME_LEN
|
||||
#define RTAPI_NAME_LEN 31
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
RTAPI_MSG_NONE = 0,
|
||||
RTAPI_MSG_ERR,
|
||||
RTAPI_MSG_WARN,
|
||||
RTAPI_MSG_INFO,
|
||||
RTAPI_MSG_DBG,
|
||||
RTAPI_MSG_ALL
|
||||
} msg_level_t;
|
||||
|
||||
RTAPI_BEGIN_DECLS
|
||||
|
||||
static inline int rtapi_snprintf(char *buf, unsigned long size, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int rc = vsnprintf(buf, static_cast<size_t>(size), fmt, ap);
|
||||
va_end(ap);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline int rtapi_vsnprintf(char *buf, unsigned long size, const char *fmt, va_list ap) {
|
||||
return vsnprintf(buf, static_cast<size_t>(size), fmt, ap);
|
||||
}
|
||||
|
||||
static inline void rtapi_print(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static inline void rtapi_print_msg(msg_level_t, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static inline int rtapi_set_msg_level(int) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int rtapi_get_msg_level(void) {
|
||||
return RTAPI_MSG_ALL;
|
||||
}
|
||||
|
||||
RTAPI_END_DECLS
|
||||
29
wasm-port/runtime/core/shims/tooldata/tooldata.hh
Normal file
29
wasm-port/runtime/core/shims/tooldata/tooldata.hh
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "emc/nml_intf/emctool.h"
|
||||
|
||||
enum {
|
||||
IDX_OK = 0,
|
||||
};
|
||||
|
||||
inline CANON_TOOL_TABLE tooldata_entry_init()
|
||||
{
|
||||
CANON_TOOL_TABLE tool{};
|
||||
tool.toolno = 0;
|
||||
tool.pocketno = 0;
|
||||
return tool;
|
||||
}
|
||||
|
||||
inline int tooldata_find_index_for_tool(int toolno)
|
||||
{
|
||||
return toolno == 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
inline int tooldata_get(CANON_TOOL_TABLE *tool, int index)
|
||||
{
|
||||
if ((tool == nullptr) || (index != 0)) {
|
||||
return -1;
|
||||
}
|
||||
*tool = tooldata_entry_init();
|
||||
return IDX_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user