Get rid of entrypoint, specify the main function name directly.

This commit is contained in:
Sadie Powell 2022-05-07 19:49:56 +01:00
parent ed95dcf44a
commit 507887f001
5 changed files with 8 additions and 13 deletions

View File

@ -51,7 +51,6 @@
#if defined _WIN32
# include "inspircd_win32wrapper.h"
#else
# define ENTRYPOINT int main(int argc, char** argv)
# define DllExport __attribute__ ((visibility ("default")))
# define CoreExport __attribute__ ((visibility ("default")))
# include <unistd.h>

View File

@ -524,8 +524,6 @@ public:
ClientProtocol::RFCEvents& GetRFCEvents() { return rfcevents; }
};
ENTRYPOINT;
inline void stdalgo::cull_delete::operator()(Cullable* item)
{
if (item)

View File

@ -718,13 +718,11 @@ void InspIRCd::SetSignal(int signal)
s_signal = 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
#ifdef _WIN32
int smain(int argc, char** argv)
#else
int main(int argc, char** argv)
#endif
{
new InspIRCd(argc, argv);
ServerInstance->Run();

View File

@ -66,9 +66,6 @@
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* Redirect main() through a different method in win32service.cpp, to intercept service startup */
#define ENTRYPOINT CoreExport int smain(int argc, char** argv)
/* Disable the deprecation warnings.. it spams :P */
#define _CRT_SECURE_NO_DEPRECATE
#define _WINSOCK_DEPRECATED_NO_WARNINGS

View File

@ -24,6 +24,9 @@
#ifdef _WIN32
/* Redirect main() through a different method in win32service.cpp, to intercept service startup */
int smain(int argc, char** argv);
/* Hook for win32service.cpp to exit properly with the service specific error code */
void SetServiceStopped(unsigned long dwStatus);