Add Rust 2015 edition test for nested modules

This commit is contained in:
Vincent Tavernier
2020-04-16 00:10:51 +02:00
parent 733a19296a
commit 1ed32adafb
13 changed files with 145 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
typedef struct ExportMe {
uint64_t val;
} ExportMe;
void export_me(ExportMe *val);
+20
View File
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
typedef struct ExportMe {
uint64_t val;
} ExportMe;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
void export_me(ExportMe *val);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+12
View File
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
typedef struct {
uint64_t val;
} ExportMe;
void export_me(ExportMe *val);
+20
View File
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
typedef struct {
uint64_t val;
} ExportMe;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
void export_me(ExportMe *val);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+16
View File
@@ -0,0 +1,16 @@
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <new>
static const uint8_t EXPORT_ME_TOO = 42;
struct ExportMe {
uint64_t val;
};
extern "C" {
void export_me(ExportMe *val);
} // extern "C"
+12
View File
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
struct ExportMe {
uint64_t val;
};
void export_me(struct ExportMe *val);
+20
View File
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_ME_TOO 42
struct ExportMe {
uint64_t val;
};
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
void export_me(struct ExportMe *val);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+6
View File
@@ -0,0 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "mod_2015"
version = "0.1.0"
+9
View File
@@ -0,0 +1,9 @@
[package]
name = "mod_2015"
version = "0.1.0"
authors = ["cbindgen"]
edition = "2015"
[lib]
name = "mod_2015"
crate-type = ["lib", "dylib"]
+2
View File
@@ -0,0 +1,2 @@
[parse]
parse_deps = false
+1
View File
@@ -0,0 +1 @@
pub mod nested;
+1
View File
@@ -0,0 +1 @@
pub mod other;
+14
View File
@@ -0,0 +1,14 @@
#[repr(C)]
pub struct ExportMe {
val: u64
}
#[repr(C)]
pub struct DoNotExportMe {
val: u64
}
pub const EXPORT_ME_TOO: u8 = 0x2a;
#[no_mangle]
pub unsafe extern "C" fn export_me(val: *mut ExportMe) { }