aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-03-18 20:47:29 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-03-18 20:47:29 +0100
commitefdea080a27d51b522f2414873e5c112201b71e6 (patch)
tree1f1d9a12230dd356fd7e2bde17200e8abdf1d3b3 /src/main.cpp
parent79112159f8f87efb5aa6fc98def89f4cd50545e8 (diff)
downloadsciteco-efdea080a27d51b522f2414873e5c112201b71e6.tar.gz
declare all global inter-dependant objects in main.cpp and get rid of init_priority attribute
* we cannot use weak symbols in MinGW, so we avoid init_priority for symbol initialization by compiling the empty definitions into sciteco-minimal but the real ones into sciteco (had to add new file symbols-minimal.cpp) * this fixes compilation/linking on LLVM Clang AND Dragonegg since their init_priority attribute is broken! this will likely be fixed in the near future but broken versions will be around for some time
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 968b816..86c6da5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -47,6 +47,26 @@
#define INI_FILE "teco.ini"
#endif
+/*
+ * defining the global objects here ensures
+ * a ctor/dtor order without depending on the
+ * GCC init_priority() attribute
+ */
+#ifdef INTERFACE_GTK
+InterfaceGtk interface;
+#elif defined(INTERFACE_NCURSES)
+InterfaceNCurses interface;
+#endif
+
+/*
+ * Scintilla will be initialized after these
+ * ctors (in main()), but dtors are guaranteed
+ * to be executed before Scintilla's
+ * destruction
+ */
+QRegisterTable QRegisters::globals;
+Ring ring;
+
namespace Flags {
tecoInt ed = 0;
}