creating merge conflicts just because I can
parent
7737ee8bc1
commit
e0db8d1627
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
// TOP
|
// TOP
|
||||||
|
|
||||||
//#define FM_PRINT_COMMANDS
|
#define FM_PRINT_COMMANDS
|
||||||
|
|
||||||
#include "../4ed_defines.h"
|
#include "../4ed_defines.h"
|
||||||
|
|
||||||
|
@ -327,6 +327,22 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
# error gcc options not set for this platform
|
# error gcc options not set for this platform
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
internal i32
|
||||||
|
get_freetype_include(char *out, u32 max){
|
||||||
|
i32 size = 0;
|
||||||
|
#if defined(IS_LINUX)
|
||||||
|
char freetype_include[512];
|
||||||
|
FILE *file = popen("pkg-config --cflags freetype2", "r");
|
||||||
|
if (file != 0){
|
||||||
|
fgets(freetype_include, sizeof(freetype_include), file);
|
||||||
|
size = strlen(freetype_include);
|
||||||
|
freetype_include[size-1] = 0;
|
||||||
|
pclose(file);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return(size);
|
||||||
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, char *out_file, char **defines, char **exports, char **inc_folders){
|
build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, char *out_file, char **defines, char **exports, char **inc_folders){
|
||||||
Build_Line line;
|
Build_Line line;
|
||||||
|
@ -348,26 +364,6 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
fm_add_to_line(line, GCC_OPTS);
|
fm_add_to_line(line, GCC_OPTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (flags & INCLUDES){
|
|
||||||
#if defined(IS_LINUX)
|
|
||||||
i32 size = 0;
|
|
||||||
char freetype_include[512];
|
|
||||||
FILE *file = popen("pkg-config --cflags freetype2", "r");
|
|
||||||
if (file != 0){
|
|
||||||
fgets(freetype_include, sizeof(freetype_include), file);
|
|
||||||
size = strlen(freetype_include);
|
|
||||||
freetype_include[size-1] = 0;
|
|
||||||
pclose(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
fm_add_to_line(line, GCC_INCLUDES" %s", freetype_include);
|
|
||||||
#else
|
|
||||||
fm_add_to_line(line, GCC_INCLUDES);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fm_add_to_line(line, "-I%s", code_path);
|
fm_add_to_line(line, "-I%s", code_path);
|
||||||
if (inc_folders != 0){
|
if (inc_folders != 0){
|
||||||
for (u32 i = 0; inc_folders[i] != 0; ++i){
|
for (u32 i = 0; inc_folders[i] != 0; ++i){
|
||||||
|
@ -518,8 +514,18 @@ build_main(char *cdir, b32 update_local_theme, u32 flags, u32 arch){
|
||||||
{
|
{
|
||||||
char *file = fm_str("4ed_app_target.cpp");
|
char *file = fm_str("4ed_app_target.cpp");
|
||||||
char **exports = fm_list_one_item("app_get_functions");
|
char **exports = fm_list_one_item("app_get_functions");
|
||||||
|
|
||||||
|
char **build_includes = includes;
|
||||||
|
|
||||||
|
char ft_include[512];
|
||||||
|
i32 ft_size = get_freetype_include(ft_include, sizeof(ft_include) - 1);
|
||||||
|
if (ft_size > 0){
|
||||||
|
ft_include[ft_size] = 0;
|
||||||
|
build_includes = fm_list(build_includes, fm_list_one_item(ft_include));
|
||||||
|
}
|
||||||
|
|
||||||
BEGIN_TIME_SECTION();
|
BEGIN_TIME_SECTION();
|
||||||
build(OPTS | SHARED_CODE | flags, arch, cdir, file, dir, "4ed_app" DLL, get_defines_from_flags(flags), exports, includes);
|
build(OPTS | SHARED_CODE | flags, arch, cdir, file, dir, "4ed_app" DLL, get_defines_from_flags(flags), exports, build_includes);
|
||||||
END_TIME_SECTION("build 4ed_app");
|
END_TIME_SECTION("build 4ed_app");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,18 @@
|
||||||
|
|
||||||
// TOP
|
// TOP
|
||||||
|
|
||||||
|
enum CV_ID{
|
||||||
|
CANCEL_CV0,
|
||||||
|
CANCEL_CV1,
|
||||||
|
CANCEL_CV2,
|
||||||
|
CANCEL_CV3,
|
||||||
|
CANCEL_CV4,
|
||||||
|
CANCEL_CV5,
|
||||||
|
CANCEL_CV6,
|
||||||
|
CANCEL_CV7,
|
||||||
|
CV_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
struct Thread_Context{
|
struct Thread_Context{
|
||||||
u32 job_id;
|
u32 job_id;
|
||||||
b32 running;
|
b32 running;
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
#include "4ed_link_system_functions.cpp"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Linux macros
|
// Linux macros
|
||||||
//
|
//
|
||||||
|
@ -231,22 +229,22 @@ struct Condition_Variable{
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
system_acquire_lock(Mutex *m){
|
system_acquire_lock(Mutex *m){
|
||||||
pthread_mutex_lock(m->crit);
|
pthread_mutex_lock(&m->crit);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
system_release_lock(Mutex *m){
|
system_release_lock(Mutex *m){
|
||||||
pthread_mutex_unlock(m->crit);
|
pthread_mutex_unlock(&m->crit);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
system_wait_cv(Condition_Variable *cv, Mutex *m){
|
system_wait_cv(Condition_Variable *cv, Mutex *m){
|
||||||
pthread_cond_wait(cv->cv, m->crit);
|
pthread_cond_wait(&cv->cv, &m->crit);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
system_signal_cv(Condition_Variable *cv, Mutex *m){
|
system_signal_cv(Condition_Variable *cv, Mutex *m){
|
||||||
pthread_cond_signal(cv->cv);
|
pthread_cond_signal(&cv->cv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK(allen): Reduce this down to just one layer of call.
|
// HACK(allen): Reduce this down to just one layer of call.
|
||||||
|
@ -2055,7 +2053,7 @@ main(int argc, char **argv){
|
||||||
threadvars.thread_memory = thread_memory;
|
threadvars.thread_memory = thread_memory;
|
||||||
|
|
||||||
sem_init(&linuxvars.thread_semaphore, 0, 0);
|
sem_init(&linuxvars.thread_semaphore, 0, 0);
|
||||||
threadvars.queues[BACKGROUND_THREADS].semaphore = LinuxSemToHandle(&linuxvars.thread_semaphore);
|
threadvars.queues[BACKGROUND_THREADS].semaphore = handle_sem(&linuxvars.thread_semaphore);
|
||||||
|
|
||||||
for(i32 i = 0; i < threadvars.groups[BACKGROUND_THREADS].count; ++i){
|
for(i32 i = 0; i < threadvars.groups[BACKGROUND_THREADS].count; ++i){
|
||||||
Thread_Context *thread = threadvars.groups[BACKGROUND_THREADS].threads + i;
|
Thread_Context *thread = threadvars.groups[BACKGROUND_THREADS].threads + i;
|
||||||
|
|
|
@ -123,18 +123,6 @@ struct Win32_Coroutine{
|
||||||
i32 done;
|
i32 done;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CV_ID{
|
|
||||||
CANCEL_CV0,
|
|
||||||
CANCEL_CV1,
|
|
||||||
CANCEL_CV2,
|
|
||||||
CANCEL_CV3,
|
|
||||||
CANCEL_CV4,
|
|
||||||
CANCEL_CV5,
|
|
||||||
CANCEL_CV6,
|
|
||||||
CANCEL_CV7,
|
|
||||||
CV_COUNT
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Win32_Vars{
|
struct Win32_Vars{
|
||||||
App_Functions app;
|
App_Functions app;
|
||||||
Custom_API custom_api;
|
Custom_API custom_api;
|
||||||
|
|
Loading…
Reference in New Issue