generate bindings for non-public extern items

Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
This commit is contained in:
Marin Veršić
2023-07-19 10:44:41 +02:00
committed by Emilio Cobos Álvarez
parent acb1b8d89e
commit 5f235ec199
8 changed files with 130 additions and 73 deletions
+12
View File
@@ -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
+17
View File
@@ -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"
+15
View File
@@ -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();
+13
View File
@@ -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()
{ }