mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-08 17:11:47 +02:00
Update POCO to 1.11.0
This commit is contained in:
48
vendor/POCO/Util/src/Application.cpp
vendored
48
vendor/POCO/Util/src/Application.cpp
vendored
@@ -40,6 +40,8 @@
|
||||
#endif
|
||||
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
|
||||
#include "Poco/SignalHandler.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
|
||||
@@ -94,12 +96,12 @@ Application::~Application()
|
||||
void Application::setup()
|
||||
{
|
||||
poco_assert (_pInstance == 0);
|
||||
|
||||
|
||||
_pConfig->add(new SystemConfiguration, PRIO_SYSTEM, false);
|
||||
_pConfig->add(new MapConfiguration, PRIO_APPLICATION, true);
|
||||
|
||||
|
||||
addSubsystem(new LoggingSubsystem);
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
|
||||
_workingDirAtLaunch = Path::current();
|
||||
|
||||
@@ -186,15 +188,15 @@ void Application::initialize(Application& self)
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Application::uninitialize()
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
for (auto& pSub: _subsystems)
|
||||
for (SubsystemVec::reverse_iterator it = _subsystems.rbegin(); it != _subsystems.rend(); ++it)
|
||||
{
|
||||
_pLogger->debug(std::string("Uninitializing subsystem: ") + pSub->name());
|
||||
pSub->uninitialize();
|
||||
_pLogger->debug(std::string("Uninitializing subsystem: ") + (*it)->name());
|
||||
(*it)->uninitialize();
|
||||
}
|
||||
_initialized = false;
|
||||
}
|
||||
@@ -321,13 +323,37 @@ void Application::stopOptionsProcessing()
|
||||
}
|
||||
|
||||
|
||||
Application::WindowSize Application::windowSize()
|
||||
{
|
||||
WindowSize size{0, 0};
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
|
||||
{
|
||||
size.width = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||
size.height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||
}
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
struct winsize winsz;
|
||||
if (ioctl(0, TIOCGWINSZ , &winsz) != -1)
|
||||
{
|
||||
size.width = winsz.ws_col;
|
||||
size.height = winsz.ws_row;
|
||||
}
|
||||
#endif
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
int Application::run()
|
||||
{
|
||||
int rc = EXIT_CONFIG;
|
||||
initialize(*this);
|
||||
|
||||
try
|
||||
{
|
||||
initialize(*this);
|
||||
rc = EXIT_SOFTWARE;
|
||||
rc = main(_unprocessedArgs);
|
||||
}
|
||||
@@ -373,7 +399,7 @@ void Application::setArgs(int argc, char* argv[])
|
||||
void Application::setArgs(const ArgVec& args)
|
||||
{
|
||||
poco_assert (!args.empty());
|
||||
|
||||
|
||||
_command = args[0];
|
||||
_pConfig->setInt("application.argc", (int) args.size());
|
||||
_unprocessedArgs = args;
|
||||
@@ -453,7 +479,7 @@ void Application::getApplicationPath(Poco::Path& appPath) const
|
||||
bool Application::findFile(Poco::Path& path) const
|
||||
{
|
||||
if (path.isAbsolute()) return true;
|
||||
|
||||
|
||||
Path appPath;
|
||||
getApplicationPath(appPath);
|
||||
Path base = appPath.parent();
|
||||
@@ -499,7 +525,7 @@ bool Application::findAppConfigFile(const std::string& appName, const std::strin
|
||||
bool Application::findAppConfigFile(const Path& basePath, const std::string& appName, const std::string& extension, Path& path) const
|
||||
{
|
||||
poco_assert (!appName.empty());
|
||||
|
||||
|
||||
Path p(basePath,appName);
|
||||
p.setExtension(extension);
|
||||
bool found = findFile(p);
|
||||
|
3
vendor/POCO/Util/src/ServerApplication.cpp
vendored
3
vendor/POCO/Util/src/ServerApplication.cpp
vendored
@@ -42,6 +42,7 @@
|
||||
#include <cstring>
|
||||
#endif
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#include "Poco/Format.h"
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@@ -334,7 +335,7 @@ bool ServerApplication::hasConsole()
|
||||
void ServerApplication::registerService()
|
||||
{
|
||||
std::string name = config().getString("application.baseName");
|
||||
std::string path = config().getString("application.path");
|
||||
std::string path = Poco::format("\"%s\"", config().getString("application.path"));
|
||||
|
||||
WinService service(name);
|
||||
if (_displayName.empty())
|
||||
|
5
vendor/POCO/Util/src/SystemConfiguration.cpp
vendored
5
vendor/POCO/Util/src/SystemConfiguration.cpp
vendored
@@ -12,6 +12,11 @@
|
||||
//
|
||||
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
|
||||
#include "Poco/Util/SystemConfiguration.h"
|
||||
#include "Poco/Environment.h"
|
||||
#include "Poco/Path.h"
|
||||
|
2
vendor/POCO/Util/src/WinService.cpp
vendored
2
vendor/POCO/Util/src/WinService.cpp
vendored
@@ -284,7 +284,7 @@ void WinService::setFailureActions(FailureActionVector failureActions, const std
|
||||
}
|
||||
|
||||
ac.dwResetPeriod = 0;
|
||||
ac.cActions = failureActions.size();
|
||||
ac.cActions = static_cast<DWORD>(failureActions.size());
|
||||
ac.lpsaActions = actions;
|
||||
|
||||
if (!ChangeServiceConfig2W(_svcHandle, SERVICE_CONFIG_FAILURE_ACTIONS, &ac))
|
||||
|
Reference in New Issue
Block a user