summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-02 13:36:38 -0500
committerpommicket <pommicket@gmail.com>2023-01-02 13:36:38 -0500
commitc0d0117a963cf8e4dfb28b919087d8a8ecbbca6e (patch)
tree0c412921f82f141cf733e8de4b4b02152446dba5 /main.c
parent1dc24e79ec7cf80e06b9c4e7cc55e18857b624c1 (diff)
fix up restructuring
Diffstat (limited to 'main.c')
-rw-r--r--main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/main.c b/main.c
index 9433c4d..f8e07d7 100644
--- a/main.c
+++ b/main.c
@@ -54,19 +54,11 @@ FUTURE FEATURES:
- LSP request timeout
*/
-#include "base.h"
-no_warn_start
-#if _WIN32
-#include <SDL.h>
-#else
-#if DEBUG || __TINYC__ // speed up compile time on debug, also tcc doesn't have immintrin.h
-#define SDL_DISABLE_IMMINTRIN_H
-#endif
-#include <SDL2/SDL.h>
-#endif
-no_warn_end
+#include "ted.h"
+
#include <locale.h>
#include <wctype.h>
+#include <signal.h>
#if __linux__
#include <execinfo.h>
#endif
@@ -78,6 +70,13 @@ no_warn_end
#pragma comment(lib, "shell32.lib")
#endif
+
+#if !defined ONE_SOURCE && !defined DEBUG
+ #define ONE_SOURCE 1
+#endif
+
+#if ONE_SOURCE
+
#include "util.c"
#if _WIN32
@@ -114,12 +113,15 @@ no_warn_end
#include "lsp-write.c"
#include "lsp-parse.c"
+#endif // ONE_SOURCE
+
#if PROFILE
#define PROFILE_TIME(var) double var = time_get_seconds();
#else
#define PROFILE_TIME(var)
#endif
+
static Rect error_box_rect(Ted *ted) {
Font *font = ted->font;
const Settings *settings = ted_active_settings(ted);