diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-12-22 00:20:45 -0800 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2017-12-22 00:26:46 -0800 |
commit | eeacb675ab14ce294af988777f57124fb9e5539a (patch) | |
tree | abbcf2e97d5705790083f2354ba3e7e273eb8a34 | |
parent | 5bc2b604b4c72e766ae9e2f5eefaa6c444f508d1 (diff) |
platform_timezones.cpp: avoid non-standard typeof
Building with recent Clang in C++ mode fails when using the non-standard
typeof operator. We can't rely on the new(ish) decltype yet, so use
the Boost implementation instead.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r-- | src/platform_adapters/linux/platform_timezones.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/platform_adapters/linux/platform_timezones.cpp b/src/platform_adapters/linux/platform_timezones.cpp index 6c6884e..f131cfb 100644 --- a/src/platform_adapters/linux/platform_timezones.cpp +++ b/src/platform_adapters/linux/platform_timezones.cpp @@ -26,6 +26,8 @@ # include <dlfcn.h> #endif +#include <boost/typeof/typeof.hpp> + #include "timezones.h" #include "vtimezone.h" #include "sysync_debug.h" @@ -70,13 +72,13 @@ static icalarray *ICALTIMEZONE_GET_BUILTIN_TIMEZONES() // because we won't reuse stale pointers. memset(&icalcontext, 0, sizeof(icalcontext)); icalcontext.icaltimezone_get_builtin_timezones_p = - (typeof(icalcontext.icaltimezone_get_builtin_timezones_p))dlsym(RTLD_DEFAULT, "icaltimezone_get_builtin_timezones"); + (BOOST_TYPEOF(icalcontext.icaltimezone_get_builtin_timezones_p))dlsym(RTLD_DEFAULT, "icaltimezone_get_builtin_timezones"); icalcontext.icalarray_element_at_p = - (typeof(icalcontext.icalarray_element_at_p))dlsym(RTLD_DEFAULT, "icalarray_element_at"); + (BOOST_TYPEOF(icalcontext.icalarray_element_at_p))dlsym(RTLD_DEFAULT, "icalarray_element_at"); icalcontext.icaltimezone_get_component_p = - (typeof(icalcontext.icaltimezone_get_component_p))dlsym(RTLD_DEFAULT, "icaltimezone_get_component"); + (BOOST_TYPEOF(icalcontext.icaltimezone_get_component_p))dlsym(RTLD_DEFAULT, "icaltimezone_get_component"); icalcontext.icalcomponent_as_ical_string_p = - (typeof(icalcontext.icalcomponent_as_ical_string_p))dlsym(RTLD_DEFAULT, "icalcomponent_as_ical_string_r"); + (BOOST_TYPEOF(icalcontext.icalcomponent_as_ical_string_p))dlsym(RTLD_DEFAULT, "icalcomponent_as_ical_string_r"); if (icalcontext.icalcomponent_as_ical_string_p) { // found icalcomponent_as_ical_string_r() which always requires freeing icalcontext.must_free_strings = TRUE; @@ -85,13 +87,13 @@ static icalarray *ICALTIMEZONE_GET_BUILTIN_TIMEZONES() // require freeing the returned string; this can be determined by checking // for "ical_memfixes" (EDS libical) icalcontext.icalcomponent_as_ical_string_p = - (typeof(icalcontext.icalcomponent_as_ical_string_p))dlsym(RTLD_DEFAULT, "icalcomponent_as_ical_string"); + (BOOST_TYPEOF(icalcontext.icalcomponent_as_ical_string_p))dlsym(RTLD_DEFAULT, "icalcomponent_as_ical_string"); icalcontext.must_free_strings = dlsym(RTLD_DEFAULT, "ical_memfixes") != NULL; } icalcontext.icaltzutil_set_exact_vtimezones_support = - (typeof(icalcontext.icaltzutil_set_exact_vtimezones_support))dlsym(RTLD_DEFAULT, "icaltzutil_set_exact_vtimezones_support"); + (BOOST_TYPEOF(icalcontext.icaltzutil_set_exact_vtimezones_support))dlsym(RTLD_DEFAULT, "icaltzutil_set_exact_vtimezones_support"); icalcontext.icalrecur_iterator_set_start = - (typeof(icalcontext.icalrecur_iterator_set_start))dlsym(RTLD_DEFAULT, "icalrecur_iterator_set_start"); + (BOOST_TYPEOF(icalcontext.icalrecur_iterator_set_start))dlsym(RTLD_DEFAULT, "icalrecur_iterator_set_start"); return icalcontext.icaltimezone_get_builtin_timezones_p ? icalcontext.icaltimezone_get_builtin_timezones_p() : |