summaryrefslogtreecommitdiffstats
path: root/unix/tclEpollNotfy.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
commit4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch)
treed5db4ca8a1fecbd63d9e72730fad2f404367daff /unix/tclEpollNotfy.c
parent63994a73e3f641451b26f48f697b6a069863751c (diff)
parent52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff)
downloadtcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2
Merge 8.7
Diffstat (limited to 'unix/tclEpollNotfy.c')
-rw-r--r--unix/tclEpollNotfy.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c
index 4d75781..f1d8cca 100644
--- a/unix/tclEpollNotfy.c
+++ b/unix/tclEpollNotfy.c
@@ -16,7 +16,9 @@
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
* in tclMacOSXNotify.c */
#if defined(NOTIFIER_EPOLL) && TCL_THREADS
-#define _GNU_SOURCE /* For pipe2(2) */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE /* For pipe2(2) */
+#endif
#include <fcntl.h>
#include <signal.h>
#include <sys/epoll.h>
@@ -238,7 +240,7 @@ PlatformEventsControl(
newEvent.events |= EPOLLOUT;
}
if (isNew) {
- newPedPtr = Tcl_Alloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)Tcl_Alloc(sizeof(struct PlatformEventData));
newPedPtr->filePtr = filePtr;
newPedPtr->tsdPtr = tsdPtr;
filePtr->pedPtr = newPedPtr;
@@ -370,7 +372,7 @@ PlatformEventsInit(void)
if (errno) {
Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex");
}
- filePtr = Tcl_Alloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
#ifdef HAVE_EVENTFD
tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (tsdPtr->triggerEventFd <= 0) {
@@ -391,7 +393,7 @@ PlatformEventsInit(void)
PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = Tcl_Alloc(
+ tsdPtr->readyEvents = (struct epoll_event *)Tcl_Alloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -550,7 +552,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -733,7 +735,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -772,7 +774,7 @@ Tcl_WaitForEvent(
numFound = PlatformEventsWait(tsdPtr->readyEvents,
tsdPtr->maxReadyEvents, timeoutPtr);
for (numEvent = 0; numEvent < numFound; numEvent++) {
- pedPtr = tsdPtr->readyEvents[numEvent].data.ptr;
+ pedPtr = (struct PlatformEventData*)tsdPtr->readyEvents[numEvent].data.ptr;
filePtr = pedPtr->filePtr;
mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]);
#ifdef HAVE_EVENTFD
@@ -810,7 +812,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;