more work on linkage

This commit is contained in:
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 local_const static const
#define global_const static const
#define external extern "C"
#define ArrayCount(a) ((sizeof(a))/(sizeof(*a)))
#define ExpandArray(a) (a), (ArrayCount(a))

View File

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

View File

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