diff options
author | cvs2svn <> | 2001-05-08 15:16:50 +0000 |
---|---|---|
committer | cvs2svn <> | 2001-05-08 15:16:50 +0000 |
commit | fbd1d6e2a390bf9a137ee6aea8153ce3dfa82154 (patch) | |
tree | 901a51781e9011d3a2db42bd08cce9e8236449cc /winsup/cygwin | |
parent | 4a39e41e48923241b90cb82881c60758d4f2ee87 (diff) | |
download | newlib-github/cygwin-1-3-2.zip newlib-github/cygwin-1-3-2.tar.gz newlib-github/cygwin-1-3-2.tar.bz2 |
This commit was manufactured by cvs2svn to create branch 'cygwin-1-3-2'.github/cygwin-1-3-2cygwin-1-3-2
Sprout from cygwin-1-3-1 2001-04-22 16:19:29 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-1-3-1'.'
Cherrypick from master 2001-05-08 15:16:49 UTC Christopher Faylor <me@cgf.cx> '* cygheap.cc (_cfree): Add regparm attribute.':
winsup/cygwin/lib/_cygwin_S_IEXEC.cc
winsup/cygwin/localtime.c
winsup/cygwin/regexp/regexp.c
winsup/cygwin/shortcut.c
Delete:
winsup/cygwin/autoload.h
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/autoload.h | 82 | ||||
-rw-r--r-- | winsup/cygwin/lib/_cygwin_S_IEXEC.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/localtime.c | 4 | ||||
-rw-r--r-- | winsup/cygwin/regexp/regexp.c | 2 | ||||
-rw-r--r-- | winsup/cygwin/shortcut.c | 3 |
5 files changed, 5 insertions, 92 deletions
diff --git a/winsup/cygwin/autoload.h b/winsup/cygwin/autoload.h deleted file mode 100644 index b51df41..0000000 --- a/winsup/cygwin/autoload.h +++ /dev/null @@ -1,82 +0,0 @@ -/* autoload.h: Define functions for auto-loading symbols from a DLL. - - Copyright 1999, 2000 Cygnus Solutions. - - Written by Christopher Faylor <cgf@cygnus.com> - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#define LoadDLLinitfunc(dllname) \ -HANDLE NO_COPY dllname ## _handle = NULL; \ -/*static*/ int dllname ## _init () __asm__ (#dllname "_init"); \ -/*static*/ int dllname ## _init () - -#define LoadDLLinitnow(dllname) \ - ({__asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); dllname##_init ();}) - -#define _LoadDLLinitnow(dllname) \ - __asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); \ - __asm__ ("call " #dllname "_init"); \ - -#define LoadDLLinit(dllname) \ - __asm__ (".section .data_cygwin_nocopy,\"w\""); \ - __asm__ (#dllname "_init_holder: .long " #dllname "_init_and_load"); \ - __asm__ (".text"); \ - __asm__ (#dllname "_init_and_load:"); \ - _LoadDLLinitnow (dllname); \ - __asm__ ("jmp cygwin_dll_func_load"); - - -/* Macro for defining "auto-load" functions. - * Note that this is self-modifying code *gasp*. - * The first invocation of a routine will trigger the loading of - * the DLL. This will then be followed by the discovery of - * the procedure's entry point, which is placed into the location - * pointed to by the stack pointer. This code then changes - * the "call" operand which invoked it to a "jmp" which will - * transfer directly to the DLL function on the next invocation. - * - * Subsequent calls to routines whose transfer address has not been - * determined will skip the "load the dll" step, starting at the - * "discovery of the DLL" step. - * - * So, immediately following the the call to one of the above routines - * we have: - * foojmp (4 bytes) Pointer to a word containing the routine used - * to eventually invoke the function. Initially - * points to an init function which loads the - * DLL, gets the process's load address, - * changes the contents here to point to the - * function address, and changes the call *(%eax) - * to a jmp %eax. If the initialization has been - * done, only the load part is done. - * DLL handle (4 bytes) The handle to use when loading the DLL. - * flag (4 bytes) If "TRUE" then it is not a fatal error if this - * function cannot be found. Instead, error is set - * to ERROR_PROC_NOT_FOUND and 0 is returned. - * func name (n bytes) asciz string containing the name of the function - * to be loaded. - */ - -#define LoadDLLmangle(name, n) #name "@" #n -#define LoadDLLfunc(name, n, dllname) LoadDLLfuncEx (name, n, dllname, 0) -#define LoadDLLfuncEx(name, n, dllname, notimp) \ -__asm__ (".section .data_cygwin_nocopy,\"w\""); \ -__asm__ (".global _" LoadDLLmangle (name, n)); \ -__asm__ (".global _win32_" LoadDLLmangle (name, n)); \ -__asm__ (".align 8"); \ -__asm__ ("_" LoadDLLmangle (name, n) ":"); \ -__asm__ ("_win32_" LoadDLLmangle (name, n) ":"); \ -__asm__ ("movl (" #name "jump),%eax"); \ -__asm__ ("call *(%eax)"); \ -__asm__ (#name "jump: .long " #dllname "_init_holder"); \ -__asm__ (" .long _" #dllname "_handle"); \ -__asm__ (" .long " #n "+" #notimp); \ -__asm__ (".asciz \"" #name "\""); \ -__asm__ (".text"); \ - -extern "C" void cygwin_dll_func_load () __asm__ ("cygwin_dll_func_load"); diff --git a/winsup/cygwin/lib/_cygwin_S_IEXEC.cc b/winsup/cygwin/lib/_cygwin_S_IEXEC.cc index 5f57c94..3711260 100644 --- a/winsup/cygwin/lib/_cygwin_S_IEXEC.cc +++ b/winsup/cygwin/lib/_cygwin_S_IEXEC.cc @@ -19,9 +19,3 @@ unsigned _cygwin_S_IXGRP = S_IXGRP; unsigned _cygwin_S_IXOTH = S_IXOTH; unsigned _cygwin_X_OK = X_OK; }; - -extern int __declspec (dllimport) _check_for_executable; -struct _cygwin_bob__ -{ - _cygwin_bob__ () {_check_for_executable = 1;} -} _cygwin_dummy_bob__; diff --git a/winsup/cygwin/localtime.c b/winsup/cygwin/localtime.c index 9e4a3c2..f465172 100644 --- a/winsup/cygwin/localtime.c +++ b/winsup/cygwin/localtime.c @@ -6,8 +6,8 @@ /* CYGNUS LOCAL */ #include "winsup.h" -#define lint #include <windows.h> +#define lint #define USG_COMPAT @@ -1429,7 +1429,7 @@ tzsetwall P((void)) } } #endif /* defined ALL_STATE */ -#ifdef _WIN32 +#if defined (_WIN32) || defined (__CYGWIN__) #define is_upper(c) ((unsigned)(c) - 'A' <= 26) { TIME_ZONE_INFORMATION tz; diff --git a/winsup/cygwin/regexp/regexp.c b/winsup/cygwin/regexp/regexp.c index 7bcd954..2f60d64 100644 --- a/winsup/cygwin/regexp/regexp.c +++ b/winsup/cygwin/regexp/regexp.c @@ -39,9 +39,9 @@ #include "winsup.h" #include "regexp.h" #include <stdio.h> +#include <string.h> #include <ctype.h> #include <stdlib.h> -#include <string.h> #include "regmagic.h" /* diff --git a/winsup/cygwin/shortcut.c b/winsup/cygwin/shortcut.c index b47cec5..2f7c1e1 100644 --- a/winsup/cygwin/shortcut.c +++ b/winsup/cygwin/shortcut.c @@ -10,8 +10,9 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include "winsup.h" +#define WIN32_LEAN_AND_MEAN #include <shlobj.h> +#include "winsup.h" #include <ctype.h> #include <sys/types.h> #include <sys/mount.h> |