more work on linkage

master
Allen Webster 2017-06-29 21:28:34 -04:00
parent cd633312dc
commit 3268d1c63d
3 changed files with 16 additions and 15 deletions

View File

@ -42,6 +42,7 @@ typedef double f64;
#define global static #define global static
#define local_const static const #define local_const static const
#define global_const static const #define global_const static const
#define external extern "C"
#define ArrayCount(a) ((sizeof(a))/(sizeof(*a))) #define ArrayCount(a) ((sizeof(a))/(sizeof(*a)))
#define ExpandArray(a) (a), (ArrayCount(a)) #define ExpandArray(a) (a), (ArrayCount(a))

View File

@ -41,29 +41,29 @@ typedef struct OSX_Vars{
// In C++ layer. // In C++ layer.
extern OSX_Vars osx; extern OSX_Vars osx;
void* external void*
osx_allocate(umem size); osx_allocate(umem size);
void external void
osx_resize(int width, int height); osx_resize(int width, int height);
void external void
osx_character_input(u32 code, OSX_Keyboard_Modifiers modifier_flags); osx_character_input(u32 code, OSX_Keyboard_Modifiers modifier_flags);
void external void
osx_mouse(i32 mx, i32 my, u32 type); osx_mouse(i32 mx, i32 my, u32 type);
void external void
osx_mouse_wheel(float dx, float dy); osx_mouse_wheel(float dx, float dy);
void external void
osx_step(); osx_step();
void external void
osx_init(); osx_init();
// In Objective-C layer. // In Objective-C layer.
void external void
osx_post_to_clipboard(char *str); osx_post_to_clipboard(char *str);
#endif #endif

View File

@ -18,40 +18,40 @@ OSX_Vars osx;
// TODO(allen): Implement a real allocate // TODO(allen): Implement a real allocate
#include <stdlib.h> #include <stdlib.h>
void* external void*
osx_allocate(umem size){ osx_allocate(umem size){
void *result = malloc(size); void *result = malloc(size);
return(result); return(result);
} }
void external void
osx_resize(int width, int height){ osx_resize(int width, int height){
osx.width = width; osx.width = width;
osx.height = height; osx.height = height;
// TODO // TODO
} }
void external void
osx_character_input(u32 code, OSX_Keyboard_Modifiers modifier_flags){ osx_character_input(u32 code, OSX_Keyboard_Modifiers modifier_flags){
// TODO // TODO
} }
void external void
osx_mouse(i32 mx, i32 my, u32 type){ osx_mouse(i32 mx, i32 my, u32 type){
// TODO // TODO
} }
void external void
osx_mouse_wheel(float dx, float dy){ osx_mouse_wheel(float dx, float dy){
// TODO // TODO
} }
void external void
osx_step(){ osx_step(){
// TODO // TODO
} }
void external void
osx_init(){ osx_init(){
// TODO // TODO
} }