From 9eef1530d55f69e6109e5d4348b735d008c2a666 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 29 Jul 2000 04:19:24 +0000 Subject: * include/cygwin/cygwin_dll.h: Update for modern compilers. * lib/cygwin_crt0.c: Inexplicably need to define alloca for newer compilers. * fhandler.h (fhandler_console): Add new method. * fhandler.cc (fhandler_console::set_cursor_maybe): New method. (fhandler_console::read): Set cursor if it has moved to make it visible. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/include/cygwin/cygwin_dll.h | 13 +++++++------ winsup/cygwin/lib/cygwin_crt0.c | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index ba6319b4f..21577f28b 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -573,6 +573,7 @@ private: /* Input calls */ int igncr_enabled (); int input_tcsetattr (int a, const struct termios *t); + void set_cursor_maybe (); public: diff --git a/winsup/cygwin/include/cygwin/cygwin_dll.h b/winsup/cygwin/include/cygwin/cygwin_dll.h index 08cdbdf00..cafacb23f 100644 --- a/winsup/cygwin/include/cygwin/cygwin_dll.h +++ b/winsup/cygwin/include/cygwin/cygwin_dll.h @@ -28,8 +28,9 @@ CDECL_BEGIN \ int WINAPI _cygwin_noncygwin_dll_entry (HANDLE h, DWORD reason, void *ptr); \ \ int WINAPI Entry (HANDLE h, DWORD reason, void *ptr); \ - extern int cygwin_attach_dll (); \ - extern void cygwin_detach_dll (); \ + typedef int (*mainfunc) (int, char **, char **); \ + extern int cygwin_attach_dll (HMODULE, mainfunc); \ + extern void cygwin_detach_dll (DWORD); \ CDECL_END \ \ static HANDLE storedHandle; \ @@ -41,9 +42,9 @@ static int __dllMain (int a, char **b, char **c) \ return Entry (storedHandle, storedReason, storedPtr); \ } \ \ -static int dll_index; \ +static DWORD dll_index; \ \ -int WINAPI _cygwin_dll_entry (HANDLE h, DWORD reason, void *ptr) \ +int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \ { \ int ret; \ ret = 1; \ @@ -56,7 +57,7 @@ int WINAPI _cygwin_dll_entry (HANDLE h, DWORD reason, void *ptr) \ storedReason = reason; \ storedPtr = ptr; \ dll_index = cygwin_attach_dll (h, &__dllMain); \ - if (dll_index == -1) \ + if (dll_index == (DWORD) -1) \ ret = 0; \ } \ break; \ @@ -67,7 +68,7 @@ int WINAPI _cygwin_dll_entry (HANDLE h, DWORD reason, void *ptr) \ if (ret) \ { \ cygwin_detach_dll (dll_index); \ - dll_index = -1; \ + dll_index = (DWORD) -1; \ } \ } \ break; \ diff --git a/winsup/cygwin/lib/cygwin_crt0.c b/winsup/cygwin/lib/cygwin_crt0.c index 0d961786a..6bfb07797 100644 --- a/winsup/cygwin/lib/cygwin_crt0.c +++ b/winsup/cygwin/lib/cygwin_crt0.c @@ -13,6 +13,8 @@ details. */ #include #include "crt0.h" +#define alloca __builtin_alloca + extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn)); /* for main module */ -- cgit v1.2.3