aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sciteco.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sciteco.h')
-rw-r--r--src/sciteco.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/sciteco.h b/src/sciteco.h
index 4868303..16dba69 100644
--- a/src/sciteco.h
+++ b/src/sciteco.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2025 Robin Haberkorn
+ * Copyright (C) 2012-2026 Robin Haberkorn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,10 +25,12 @@
#if TECO_INTEGER == 32
typedef gint32 teco_int_t;
-#define TECO_INT_FORMAT G_GINT32_FORMAT
+#define TECO_INT_MODIFIER G_GINT32_MODIFIER
+#define TECO_INT_FORMAT G_GINT32_FORMAT
#elif TECO_INTEGER == 64
typedef gint64 teco_int_t;
-#define TECO_INT_FORMAT G_GINT64_FORMAT
+#define TECO_INT_MODIFIER G_GINT64_MODIFIER
+#define TECO_INT_FORMAT G_GINT64_FORMAT
#else
#error Invalid TECO integer storage size
#endif
@@ -85,6 +87,7 @@ teco_is_failure(teco_bool_t x)
* This is not a bitfield, since it is set from SciTECO.
*/
enum {
+ TECO_ED_EXIT = (1 << 1),
TECO_ED_DEFAULT_ANSI = (1 << 2),
TECO_ED_AUTOCASEFOLD = (1 << 3),
TECO_ED_AUTOEOL = (1 << 4),
@@ -92,7 +95,9 @@ enum {
TECO_ED_MOUSEKEY = (1 << 6),
TECO_ED_SHELLEMU = (1 << 7),
TECO_ED_OSC52 = (1 << 8),
- TECO_ED_ICONS = (1 << 9)
+ TECO_ED_ICONS = (1 << 9),
+ TECO_ED_CLIP_PRIMARY = (1 << 10),
+ TECO_ED_MINIBUF_SSM = (1 << 11)
};
/* in main.c */
@@ -112,6 +117,16 @@ extern volatile sig_atomic_t teco_interrupted;
*/
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FILE, fclose);
+/**
+ * A "safe" compile-time assertion, which also passes if the expression is not constant.
+ *
+ * Can be useful since different compilers have different ideas about what's a constant expression.
+ * In particular GCC does not treat `static const` objects as constant (in the way it qualifies
+ * for _Static_assert()), while constexpr is only available since C23.
+ */
+#define TECO_ASSERT_SAFE(EXPR) \
+ G_STATIC_ASSERT(!__builtin_constant_p(EXPR) || (EXPR))
+
/*
* BEWARE DRAGONS!
*/