summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
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);