From b672c0782a6f8b6271fc96c1ef40b90b578bbafa Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Sun, 11 Mar 2012 23:44:52 +0000 Subject: [PATCH] Bodgy support around including X11/Xos_r.h Undefine index and rindex first to prevent clashes with tt funcs. Should be fixed by namespacing local funcs --- cde/lib/tt/lib/util/tt_host_equiv.C | 9 ++++++++- cde/lib/tt/lib/util/tt_path.C | 8 ++++++++ cde/lib/tt/lib/util/tt_string_map.C | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cde/lib/tt/lib/util/tt_host_equiv.C b/cde/lib/tt/lib/util/tt_host_equiv.C index 0aec31e1..fba3bdcb 100644 --- a/cde/lib/tt/lib/util/tt_host_equiv.C +++ b/cde/lib/tt/lib/util/tt_host_equiv.C @@ -36,8 +36,15 @@ #define X_INCLUDE_NETDB_H #define XOS_USE_XT_LOCKING +#if defined(linux) +#define index +#define rindex +#endif #include - +#if defined(linux) +#undef index +#undef rindex +#endif static int _cache_it(_Tt_hostname_cache_ptr, _Tt_string &); // This null constructor is required by the _table_of macro: diff --git a/cde/lib/tt/lib/util/tt_path.C b/cde/lib/tt/lib/util/tt_path.C index b6e354d4..8dd9f2bb 100644 --- a/cde/lib/tt/lib/util/tt_path.C +++ b/cde/lib/tt/lib/util/tt_path.C @@ -49,7 +49,15 @@ /* Included after "util/tt_string.h" to avoid index/strchr conflicts. */ #define X_INCLUDE_DIRENT_H #define XOS_USE_NO_LOCKING +#if defined(linux) +#define index +#define rindex +#endif #include +#if defined(linux) +#undef index +#undef rindex +#endif #if defined(OPT_BUG_USL) || defined(OPT_BUG_UXP) #define S_ISLNK(mode) ((mode & 0xF000) == S_IFLNK) diff --git a/cde/lib/tt/lib/util/tt_string_map.C b/cde/lib/tt/lib/util/tt_string_map.C index 2eb4cc61..0c219c77 100644 --- a/cde/lib/tt/lib/util/tt_string_map.C +++ b/cde/lib/tt/lib/util/tt_string_map.C @@ -45,7 +45,15 @@ /* Included after "util/tt_string.h" to avoid index/strchr conflicts. */ #define X_INCLUDE_STRING_H #define XOS_USE_NO_LOCKING +#if defined(linux) +#define index +#define rindex +#endif #include +#if defined(linux) +#undef index +#undef rindex +#endif _Tt_string_map:: _Tt_string_map (_Tt_object_table_keyfn key_function) -- 2.25.1