diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-08-02 18:27:33 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-08-02 18:27:33 -0400 |
commit | 272e2587a20cf755e9180937aec2d64a7fc35b84 (patch) | |
tree | e5d9d2681422327142eb3e7b74a186eb6bbc25a9 /gcc/libgcc2.c | |
parent | b080c137d7b249435e302fc38b3e3745deace292 (diff) | |
download | gcc-272e2587a20cf755e9180937aec2d64a7fc35b84.zip gcc-272e2587a20cf755e9180937aec2d64a7fc35b84.tar.gz gcc-272e2587a20cf755e9180937aec2d64a7fc35b84.tar.bz2 |
(_trampoline): Rework last change; both getpagesize and mprotect are
in cygwin32.
From-SVN: r14636
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 8f853f2..eb6a9ba 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -2718,9 +2718,7 @@ __clear_cache (char *beg, char *end) /* Jump to a trampoline, loading the static chain address. */ -#ifdef WINNT - -#ifndef __CYGWIN32__ +#if defined(WINNT) && ! defined(__CYGWIN32__) long getpagesize() { @@ -2731,28 +2729,32 @@ long getpagesize() #endif } -#endif - #ifdef i386 extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall)); #endif -int mprotect(char *addr, int len, int prot) +int +mprotect (char *addr, int len, int prot) { int np, op; - if (prot == 7) np = 0x40; - else if (prot == 5) np = 0x20; - else if (prot == 4) np = 0x10; - else if (prot == 3) np = 0x04; - else if (prot == 1) np = 0x02; - else if (prot == 0) np = 0x01; + if (prot == 7) + np = 0x40; + else if (prot == 5) + np = 0x20; + else if (prot == 4) + np = 0x10; + else if (prot == 3) + np = 0x04; + else if (prot == 1) + np = 0x02; + else if (prot == 0) + np = 0x01; if (VirtualProtect (addr, len, np, &op)) return 0; else return -1; - } #endif |