generate bindings for non-public extern items
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
acb1b8d89e
commit
5f235ec199
@@ -0,0 +1,12 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern const uint32_t FIRST;
|
||||
|
||||
extern const uint32_t RENAMED;
|
||||
|
||||
void first(void);
|
||||
|
||||
void renamed(void);
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
extern const uint32_t FIRST;
|
||||
|
||||
extern const uint32_t RENAMED;
|
||||
|
||||
void first(void);
|
||||
|
||||
void renamed(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <ostream>
|
||||
#include <new>
|
||||
|
||||
extern "C" {
|
||||
|
||||
extern const uint32_t FIRST;
|
||||
|
||||
extern const uint32_t RENAMED;
|
||||
|
||||
void first();
|
||||
|
||||
void renamed();
|
||||
|
||||
} // extern "C"
|
||||
@@ -0,0 +1,15 @@
|
||||
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 *:
|
||||
|
||||
extern const uint32_t FIRST;
|
||||
|
||||
extern const uint32_t RENAMED;
|
||||
|
||||
void first();
|
||||
|
||||
void renamed();
|
||||
@@ -0,0 +1,13 @@
|
||||
#[no_mangle]
|
||||
static FIRST: u32 = 10;
|
||||
|
||||
#[export_name = "RENAMED"]
|
||||
static SECOND: u32 = 42;
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn first()
|
||||
{ }
|
||||
|
||||
#[export_name = "renamed"]
|
||||
extern fn second()
|
||||
{ }
|
||||
Reference in New Issue
Block a user