Fix nix build (forgot it was building from git source); patch to load module & put fns in module
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "libguile/boolean.h"
|
||||
#include "libguile/foreign-object.h"
|
||||
#include "libguile/list.h"
|
||||
#include "libguile/modules.h"
|
||||
#include "libguile/numbers.h"
|
||||
#include "libguile/pairs.h"
|
||||
#include "libguile/scm.h"
|
||||
@@ -306,10 +307,12 @@ static SCM seat(void) {
|
||||
wl_list_for_each(seat, &context.seats, link)
|
||||
break;
|
||||
struct Output *output = NULL;
|
||||
if ( seat->status.focused_output != NULL )
|
||||
if ( seat->status.focused_output != NULL )
|
||||
wl_list_for_each(output, &context.outputs, link)
|
||||
if ( output->wl_output == seat->status.focused_output )
|
||||
break;
|
||||
|
||||
|
||||
return scm_make_foreign_object_3(
|
||||
seat_t,
|
||||
output != NULL ? output_for(output) : SCM_BOOL_F,
|
||||
@@ -345,10 +348,8 @@ static void *load_script_inner (void *data)
|
||||
return scm_primitive_load_path(scm_from_utf8_string(path));
|
||||
}
|
||||
|
||||
void *load_script (void *data)
|
||||
{
|
||||
SCM init_module(void *data) {
|
||||
/* Note: All guile objects are garbage collected. */
|
||||
|
||||
scm_c_define_gsubr_fix("install-handler", 2, 0, 0, install_handler);
|
||||
scm_c_define_gsubr_fix("riverctl", 1, 0, 1, riverctl);
|
||||
|
||||
@@ -374,7 +375,13 @@ void *load_script (void *data)
|
||||
#define X(t, c, scm, i) scm_c_define_gsubr_fix(scm, 1, 0, 0, c);
|
||||
getters(X)
|
||||
#undef X
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
|
||||
void *load_script (void *data)
|
||||
{
|
||||
SCM module = scm_c_resolve_module("riverguile");
|
||||
scm_c_call_with_current_module(module, init_module, NULL);
|
||||
|
||||
/* Continuation barrier causes stack unwind on exceptions to stop here.
|
||||
* Otherwise the entire stack created by scm_with_guile() would be
|
||||
|
||||
Reference in New Issue
Block a user