@@ -0,0 +1,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct TraitObject {
|
||||
void *data;
|
||||
void *vtable;
|
||||
} TraitObject;
|
||||
|
||||
void *root(const void *ptr, struct TraitObject t);
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct TraitObject {
|
||||
void *data;
|
||||
void *vtable;
|
||||
} TraitObject;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void *root(const void *ptr, struct TraitObject t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
void *vtable;
|
||||
} TraitObject;
|
||||
|
||||
void *root(const void *ptr, TraitObject t);
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
void *vtable;
|
||||
} TraitObject;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void *root(const void *ptr, TraitObject t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <ostream>
|
||||
#include <new>
|
||||
|
||||
struct TraitObject {
|
||||
void *data;
|
||||
void *vtable;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void *root(const void *ptr, TraitObject t);
|
||||
|
||||
} // extern "C"
|
||||
@@ -0,0 +1,13 @@
|
||||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t
|
||||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
|
||||
cdef extern from *:
|
||||
ctypedef bint bool
|
||||
ctypedef struct va_list
|
||||
|
||||
cdef extern from *:
|
||||
|
||||
ctypedef struct TraitObject:
|
||||
void *data;
|
||||
void *vtable;
|
||||
|
||||
void *root(const void *ptr, TraitObject t);
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct TraitObject {
|
||||
void *data;
|
||||
void *vtable;
|
||||
};
|
||||
|
||||
void *root(const void *ptr, struct TraitObject t);
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct TraitObject {
|
||||
void *data;
|
||||
void *vtable;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void *root(const void *ptr, struct TraitObject t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
@@ -0,0 +1,13 @@
|
||||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t
|
||||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
|
||||
cdef extern from *:
|
||||
ctypedef bint bool
|
||||
ctypedef struct va_list
|
||||
|
||||
cdef extern from *:
|
||||
|
||||
cdef struct TraitObject:
|
||||
void *data;
|
||||
void *vtable;
|
||||
|
||||
void *root(const void *ptr, TraitObject t);
|
||||
@@ -0,0 +1,10 @@
|
||||
#[repr(C)]
|
||||
pub struct TraitObject {
|
||||
pub data: *mut (),
|
||||
pub vtable: *mut (),
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(ptr: *const (), t: TraitObject) -> *mut () {
|
||||
std::ptr::null_mut()
|
||||
}
|
||||
Reference in New Issue
Block a user