Bug 1060: #undef HAVE_TRE_REGEX_H only in elinks.h
[elinks.git] / src / elinks.h
blob0e164a1b41ba1a28fe05259d69f5c1a8024c29aa
1 /* Global include with common functions and definitions for ELinks */
3 #ifndef EL__ELINKS_H
4 #define EL__ELINKS_H
6 #ifndef __EXTENSION__
7 #define __EXTENSION__ /* Helper for SunOS */
8 #endif
10 /* Gives us uint{32,16}_t and longlong and integer limits. */
11 #include "osdep/types.h"
13 /* This determines the system type and loads system-specific macros and
14 * symbolic constants. The other includes may reuse this. This should be
15 * always the very first ELinks include a source should include (except
16 * config.h, of course). */
17 #include "osdep/system.h"
19 /* This introduces some generic ensurements that various things are how
20 * they are supposed to be. */
21 #include "osdep/generic.h"
23 /* This loads hard-configured settings - which are too lowlevel to configure at
24 * the runtime but are too unlikely to be changed to be configured through
25 * config.h. */
26 #include "setup.h"
28 #ifdef CONFIG_DEBUG
29 #define DEBUG_MEMLEAK
30 #endif
33 /* When CONFIG_UTF8 is defined, src/viewer/text/search.c makes a string
34 * of unicode_val_T and gives it to regwexec(), which expects a string
35 * of wchar_t. If the unicode_val_T and wchar_t types are too different,
36 * this won't work, so try to detect that and disable regexp operations
37 * entirely in that case.
39 * Currently, this code only compares the sizes of the types. Because
40 * unicode_val_T is defined as uint32_t and POSIX says bytes are 8-bit,
41 * sizeof(unicode_val_T) is 4 and the following compares SIZEOF_WCHAR_T
42 * to that.
44 * C99 says the implementation can define __STDC_ISO_10646__ if wchar_t
45 * values match ISO 10646 (or Unicode) numbers in all locales. Do not
46 * check that macro here, because it is too restrictive: it should be
47 * enough for ELinks if the values match in the locales where ELinks is
48 * actually run. */
50 #ifdef CONFIG_UTF8
51 #if SIZEOF_WCHAR_T != 4
52 #undef HAVE_TRE_REGEX_H
53 #endif
54 #endif
56 /* This maybe overrides some of the standard high-level functions, to ensure
57 * the expected behaviour. These overrides are not system specific. */
58 #include "osdep/stub.h"
60 /* util/math.h is supposed to be around all the time. */
61 #include "util/math.h"
64 #endif