diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-22 05:40:25 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-22 05:40:25 +0100 |
commit | 99f6da572f455b0ba17c341ec1a63c5826de3ecf (patch) | |
tree | b4e18e283b840127c21597a857be49403b2bb06b /src/sciteco.h | |
parent | 5d5182158a982057a9fe4c7b3f3ac81e1536f1ff (diff) | |
download | sciteco-99f6da572f455b0ba17c341ec1a63c5826de3ecf.tar.gz |
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
Diffstat (limited to 'src/sciteco.h')
-rw-r--r-- | src/sciteco.h | 15 |
1 files changed, 12 insertions, 3 deletions
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) |