aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/c/main.cpp b/c/main.cpp
index e51e0f9..60504b2 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -12,6 +12,14 @@
#include "pl.h"
#include "util.h"
+#ifdef DEBUG
+#define XMAIN 30
+#define YMAIN 30
+#else
+#define XMAIN CW_USEDEFAULT
+#define YMAIN CW_USEDEFAULT
+#endif
+
/* main.cpp defines all global (non-template) variables used in the
* program. `extern' is used to access them from other files, when
* need be. */
@@ -96,12 +104,14 @@ static void OnTerminate() noexcept
int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, const int nCmdShow)
{
+ setbuf(stdout, nullptr);
+
/* Exit gracefully on uncaught exception. */
std::set_terminate(OnTerminate);
/* Initialize Prolog. */
- char* argv[] = {const_cast<char*>("EpisodeBrowser"), nullptr};
- if (!PL_initialise(1, argv))
+ const char* argv[] = {"EpisodeBrowser", nullptr};
+ if (!PL_initialise(1, const_cast<char**>(argv)))
throw std::runtime_error("Could not initialize Prolog.");
if (!Pl("track_episodes","attach") || !Pl("episode_data","attach"))
throw std::runtime_error("Could not attach databases.");
@@ -137,7 +147,7 @@ int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, cons
L"Episode Browser",
L"Episode Browser",
WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
- CW_USEDEFAULT, CW_USEDEFAULT, 0, 0,
+ XMAIN, YMAIN, 0, 0,
nullptr, nullptr, hInstance, nullptr));
g_hWndStatus = Require(CreateWindowEx(