From abb0ca5bd38254159fb4ebf632d26f3cd83a63a4 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 24 Nov 2014 21:28:25 +0000 Subject: [PATCH] Fix build without threads --- include/znc/Client.h | 1 + include/znc/Modules.h | 1 + include/znc/WebModules.h | 1 + modules/sample.cpp | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/include/znc/Client.h b/include/znc/Client.h index 855357e5..16998214 100644 --- a/include/znc/Client.h +++ b/include/znc/Client.h @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/include/znc/Modules.h b/include/znc/Modules.h index 933ad341..c0b54a6c 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/include/znc/WebModules.h b/include/znc/WebModules.h index e889f6b7..55c0a021 100644 --- a/include/znc/WebModules.h +++ b/include/znc/WebModules.h @@ -20,6 +20,7 @@ #include #include #include +#include class CAuthBase; class CUser; diff --git a/modules/sample.cpp b/modules/sample.cpp index aedc8b3f..4972f65b 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -20,6 +20,7 @@ using std::vector; +#ifdef HAVE_PTHREAD class CSampleJob : public CModuleJob { public: CSampleJob(CModule *pModule) : CModuleJob(pModule, "sample", "Message the user after a delay") {} @@ -49,6 +50,7 @@ public: GetModule()->PutModule("Sample job done"); } }; +#endif class CSampleTimer : public CTimer { public: @@ -72,7 +74,9 @@ public: //AddTimer(new CSampleTimer(this, 300, 0, "Sample", "Sample timer for sample things.")); //AddTimer(new CSampleTimer(this, 5, 20, "Another", "Another sample timer.")); //AddTimer(new CSampleTimer(this, 25000, 5, "Third", "A third sample timer.")); +#ifdef HAVE_PTHREAD AddJob(new CSampleJob(this)); +#endif return true; }