From 49e859c0d2bf41fa648e0da45a6d5b114b0d2240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 9 Aug 2022 21:51:58 +0200 Subject: 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. --- c/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'c/main.cpp') 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("EpisodeBrowser"), nullptr}; - if (!PL_initialise(1, argv)) + const char* argv[] = {"EpisodeBrowser", nullptr}; + if (!PL_initialise(1, const_cast(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( -- cgit v1.2.3