|
|
|
@ -152,11 +152,12 @@ int demo_input_fd(void){
|
|
|
|
|
// listens for events, handling mouse events directly and making other ones
|
|
|
|
|
// available to demos. returns -1 if already spawned or resource failures.
|
|
|
|
|
int input_dispatcher(struct notcurses* nc){
|
|
|
|
|
#ifndef __MINGW64__ // FIXME
|
|
|
|
|
if(input_pipefds[0] >= 0){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
// freebsd doesn't have eventfd :/ and apple doesn't even have pipe2() =[ =[
|
|
|
|
|
// omg windows doesn't have pipe() fml FIXME
|
|
|
|
|
#ifndef __MINGW64__
|
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
|
if(pipe(input_pipefds)){
|
|
|
|
|
#else
|
|
|
|
@ -165,13 +166,13 @@ int input_dispatcher(struct notcurses* nc){
|
|
|
|
|
fprintf(stderr, "Error creating pipe (%s)\n", strerror(errno));
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if(pthread_create(&tid, NULL, ultramegaok_demo, nc)){
|
|
|
|
|
close(input_pipefds[0]);
|
|
|
|
|
close(input_pipefds[1]);
|
|
|
|
|
input_pipefds[0] = input_pipefds[1] = -1;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|