19 lines
388 B
C
19 lines
388 B
C
|
|
#ifndef sys_api_h__
|
|
#define sys_api_h__
|
|
|
|
#include "stddef.h"
|
|
#include "stdint.h"
|
|
#include "stdlib.h"
|
|
|
|
typedef struct {
|
|
void *fun;
|
|
int index;
|
|
} api_item_struct;
|
|
|
|
#define api_item(fun_, index_) \
|
|
__attribute__((used, section(".sys_api"))) static const api_item_struct \
|
|
api_##index_ = {.fun = fun_, .index = index_}
|
|
|
|
#endif
|