sched: fix cpu_set_t ordering in generated header
The CPU_* inline functions in after_includes referenced cpu_set_t before cbindgen generated its definition. Move the full struct typedef into after_includes before the inline functions, and remove cpu_set_t from the [export] list to avoid duplicate definitions.
This commit is contained in:
@@ -11,6 +11,12 @@ after_includes = """
|
||||
#include <bits/timespec.h> // for timespec
|
||||
|
||||
#define CPU_SETSIZE 1024
|
||||
|
||||
/* cpu_set_t must be defined BEFORE the CPU_* inline functions */
|
||||
typedef struct cpu_set_t {
|
||||
uint64_t __bits[16];
|
||||
} cpu_set_t;
|
||||
|
||||
static inline void CPU_ZERO(cpu_set_t *set) {
|
||||
for (int i = 0; i < 16; i++) set->__bits[i] = 0;
|
||||
}
|
||||
@@ -44,7 +50,6 @@ prefix_with_name = true
|
||||
[export]
|
||||
include = [
|
||||
"sched_param",
|
||||
"cpu_set_t",
|
||||
"sched_get_priority_max",
|
||||
"sched_get_priority_min",
|
||||
"sched_getparam",
|
||||
|
||||
Reference in New Issue
Block a user