Revert "Revert "rts/base: Fix #9423"" and resolve issue that caused the revert.
authorAndreas Voellmy <andreas.voellmy@gmail.com>
Tue, 16 Sep 2014 12:56:54 +0000 (07:56 -0500)
committerAustin Seipp <austin@well-typed.com>
Tue, 16 Sep 2014 12:58:36 +0000 (07:58 -0500)
commit7e658bc14e2dd6baf208deebbdab9e1285ce4c72
tree526c6557dd697360c4bc58ff99ecdf6b60c046ed
parentcaf449e39f5e7545eeabd567349661450aa8c6e5
Revert "Revert "rts/base: Fix #9423"" and resolve issue that caused the revert.

Summary:
This reverts commit 4748f5936fe72d96edfa17b153dbfd84f2c4c053. The fix for #9423
was reverted because this commit introduced a C function setIOManagerControlFd()
(defined in Schedule.c) defined for all OS types, while the prototype
(in includes/rts/IOManager.h) was only included when mingw32_HOST_OS is
not defined. This broke Windows builds.

This commit reverts the original commit and resolves the problem by only defining
setIOManagerControlFd() when mingw32_HOST_OS is defined. Hence the missing prototype
error should not occur on Windows.

In addition, since the io_manager_control_wr_fd field of the Capability struct is only
usd by the setIOManagerControlFd, this commit includes the io_manager_control_wr_fd
field in the Capability struct only when mingw32_HOST_OS is not defined.

Test Plan: Try to compile successfully on all platforms.

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D174
includes/rts/IOManager.h
libraries/base/GHC/Event/Control.hs
libraries/base/GHC/Event/Manager.hs
libraries/base/GHC/Event/Thread.hs
libraries/base/GHC/Event/TimerManager.hs
rts/Capability.c
rts/Capability.h
rts/Linker.c
rts/posix/Signals.c