aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-09 21:51:58 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-09 21:53:02 +0200
commit49e859c0d2bf41fa648e0da45a6d5b114b0d2240 (patch)
tree980ff727517f83b286a0a2fb2ea10c87a8f93ff4 /c/main.cpp
parent805cc4cec440525629758af918d50a850209ec0b (diff)
downloadEpisodeBrowser-49e859c0d2bf41fa648e0da45a6d5b114b0d2240.tar.gz
Add eb.el.
Emacs is not a great IDE out-of-the-box, but it is very flexible -- and in many ways a lot more transparent than most normal IDEs.
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(