From 99f6da572f455b0ba17c341ec1a63c5826de3ecf Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 22 Feb 2013 05:40:25 +0100 Subject: use typedef for SciTECO integers and make it configurable at configure time * storage size should always be 64 (gint64) to aid macro portability * however, for performance reasons users compiling from source might explicitly compile with 32 bit integers --- src/sciteco.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/sciteco.h') diff --git a/src/sciteco.h b/src/sciteco.h index e40b6f4..f22842c 100644 --- a/src/sciteco.h +++ b/src/sciteco.h @@ -24,13 +24,24 @@ #include "interface.h" +#if TECO_INTEGER == 32 +typedef gint32 tecoInt; +#define TECO_INTEGER_FORMAT G_GINT32_FORMAT +#elif TECO_INTEGER == 64 +typedef gint64 tecoInt; +#define TECO_INTEGER_FORMAT G_GINT64_FORMAT +#else +#error Invalid TECO integer storage size +#endif +typedef tecoInt tecoBool; + namespace Flags { enum { ED_HOOKS = (1 << 5), ED_FNKEYS = (1 << 6) }; - extern gint64 ed; + extern tecoInt ed; } extern sig_atomic_t sigint_occurred; @@ -43,8 +54,6 @@ extern sig_atomic_t sigint_occurred; #define CTL_ECHO(C) ((C) | 0x40) #define CTL_KEY(C) ((C) & ~0x40) -typedef gint64 tecoBool; - #define SUCCESS (-1) #define FAILURE (0) #define TECO_BOOL(X) ((X) ? SUCCESS : FAILURE) -- cgit v1.2.3