aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-29 04:19:24 +0000
committerChristopher Faylor <me@cgf.cx>2000-07-29 04:19:24 +0000
commit9eef1530d55f69e6109e5d4348b735d008c2a666 (patch)
treee582c8fb84ee5380bac21f685dbc4295d9c9de94
parentd1baac7725a8c276f56d8a37f77b1c09f1857bd5 (diff)
downloadnewlib-9eef1530d55f69e6109e5d4348b735d008c2a666.zip
newlib-9eef1530d55f69e6109e5d4348b735d008c2a666.tar.gz
newlib-9eef1530d55f69e6109e5d4348b735d008c2a666.tar.bz2
* 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.
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/include/cygwin/cygwin_dll.h13
-rw-r--r--winsup/cygwin/lib/cygwin_crt0.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index ba6319b..21577f2 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 08cdbdf..cafacb2 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 0d96178..6bfb077 100644
--- a/winsup/cygwin/lib/cygwin_crt0.c
+++ b/winsup/cygwin/lib/cygwin_crt0.c
@@ -13,6 +13,8 @@ details. */
#include <sys/cygwin.h>
#include "crt0.h"
+#define alloca __builtin_alloca
+
extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn));
/* for main module */