summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-21 13:40:34 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-21 13:40:34 +0000
commit6a3319c7fcbaaaed52bd776d6d638224875ab331 (patch)
treeb49aa613035bcdd190ee69a5938b9415d678a10e
parentcc3503abc4e465c6d5c57a6e60716dafe0703aa5 (diff)
comments to explain wtf 'ENTRYPOINT' is where main() should be. In the future maybe we should have two main.cpp's one for windows and one for posix, in a similar way we do socket engines etc.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10200 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index e2ed1282c..0efbd293a 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -867,15 +867,6 @@ void InspIRCd::BufferedSocketCull()
* An ircd in five lines! bwahahaha. ahahahahaha. ahahah *cough*.
*/
-ENTRYPOINT
-{
- SI = new InspIRCd(argc, argv);
- mysig = &SI->s_signal;
- SI->Run();
- delete SI;
- return 0;
-}
-
/* this returns true when all modules are satisfied that the user should be allowed onto the irc server
* (until this returns true, a user will block in the waiting state, waiting to connect up to the
* registration timeout maximum seconds)
@@ -899,3 +890,18 @@ void InspIRCd::SetSignal(int signal)
{
*mysig = signal;
}
+
+/* On posix systems, the flow of the program starts right here, with
+ * ENTRYPOINT being a #define that defines main(). On Windows, ENTRYPOINT
+ * defines smain() and the real main() is in the service code under
+ * win32service.cpp. This allows the service control manager to control
+ * the process where we are running as a windows service.
+ */
+ENTRYPOINT
+{
+ SI = new InspIRCd(argc, argv);
+ mysig = &SI->s_signal;
+ SI->Run();
+ delete SI;
+ return 0;
+}