mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Add replacement for missing getpagesize() on MINGW
* libguile/posix-w32.c (getpagesize_w32): new procedure * libguile/posix-w32.h: declaration of getpagesize_w32 * libguile/loader.c [__MINGW32__](scm_bootstrap_loader): use new procedure * libguile/vm.c [__MINGW32__](scm_i_vm_prepare_stack): use new procedure
This commit is contained in:
parent
0b9f58c339
commit
0e20c0c8c6
4 changed files with 21 additions and 0 deletions
|
@ -52,6 +52,9 @@
|
||||||
|
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include "posix-w32.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This file contains the loader for Guile's on-disk format: ELF with
|
/* This file contains the loader for Guile's on-disk format: ELF with
|
||||||
some custom tags in the dynamic segment. */
|
some custom tags in the dynamic segment. */
|
||||||
|
@ -822,7 +825,11 @@ scm_find_slot_map_unlocked (const uint32_t *ip)
|
||||||
void
|
void
|
||||||
scm_bootstrap_loader (void)
|
scm_bootstrap_loader (void)
|
||||||
{
|
{
|
||||||
|
#ifndef __MINGW32__
|
||||||
page_size = getpagesize ();
|
page_size = getpagesize ();
|
||||||
|
#else
|
||||||
|
page_size = getpagesize_w32 ();
|
||||||
|
#endif
|
||||||
/* page_size should be a power of two. */
|
/* page_size should be a power of two. */
|
||||||
if (page_size & (page_size - 1))
|
if (page_size & (page_size - 1))
|
||||||
abort ();
|
abort ();
|
||||||
|
|
|
@ -1256,3 +1256,8 @@ dlerror_w32 ()
|
||||||
snprintf (dlerror_str, DLERROR_LEN, "error %ld: %s", (long) dw, msg_buf);
|
snprintf (dlerror_str, DLERROR_LEN, "error %ld: %s", (long) dw, msg_buf);
|
||||||
return dlerror_str;
|
return dlerror_str;
|
||||||
}
|
}
|
||||||
|
int
|
||||||
|
getpagesize_w32 (void)
|
||||||
|
{
|
||||||
|
return 4 * 1024;
|
||||||
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ SCM_INTERNAL void *dlopen_w32 (const char *name, int flags);
|
||||||
SCM_INTERNAL void *dlsym_w32 (void *handle, const char *name);
|
SCM_INTERNAL void *dlsym_w32 (void *handle, const char *name);
|
||||||
SCM_INTERNAL int dlclose_w32 (void *handle);
|
SCM_INTERNAL int dlclose_w32 (void *handle);
|
||||||
SCM_INTERNAL char *dlerror_w32 (void);
|
SCM_INTERNAL char *dlerror_w32 (void);
|
||||||
|
SCM_INTERNAL int getpagesize_w32 (void);
|
||||||
|
|
||||||
#define HAVE_UNAME 1
|
#define HAVE_UNAME 1
|
||||||
#define HAVE_WAITPID 1
|
#define HAVE_WAITPID 1
|
||||||
|
|
|
@ -72,6 +72,10 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "vm-builtins.h"
|
#include "vm-builtins.h"
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include "posix-w32.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
|
|
||||||
#include <gc/gc_mark.h>
|
#include <gc/gc_mark.h>
|
||||||
|
@ -604,7 +608,11 @@ scm_i_vm_prepare_stack (struct scm_vm *vp)
|
||||||
Guile. */
|
Guile. */
|
||||||
if (page_size == 0)
|
if (page_size == 0)
|
||||||
{
|
{
|
||||||
|
#ifndef __MINGW32__
|
||||||
page_size = getpagesize ();
|
page_size = getpagesize ();
|
||||||
|
#else
|
||||||
|
page_size = getpagesize_w32 ();
|
||||||
|
#endif
|
||||||
/* page_size should be a power of two. */
|
/* page_size should be a power of two. */
|
||||||
if (page_size & (page_size - 1))
|
if (page_size & (page_size - 1))
|
||||||
abort ();
|
abort ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue