LibComponentLogging-Core
LibComponentLogging-Core copied to clipboard
Xcode 8 build errors
The files (not installed with the Pod) currently give build errors in Xcode 8.

It looks like the main culprit is this bit of code. The complier seems to get confused about the #define
cutting off the enum declaration.
// Log components, prefixed with 'lcl_c'.
enum _lcl_enum_component_t {
# define _lcl_component(_identifier, _header, _name) \
lcl_c##_identifier, \
__lcl_log_symbol_lcl_c##_identifier = lcl_c##_identifier,
# include "lcl_config_components.h"
# undef _lcl_component
_lcl_component_t_count,
_lcl_component_t_first = 0,
_lcl_component_t_last = _lcl_component_t_count-1
};
Any idea on how to solve this?
Strangely enough, if I change that line of code to the below code, it builds fine. Obviously, this is not ideal, since I'm not using the configuration header and just typing its again in the enumeration.
// Log components, prefixed with 'lcl_c'.
# define _lcl_component(_identifier, _header, _name) \
lcl_c##_identifier, \
__lcl_log_symbol_lcl_c##_identifier = lcl_c##_identifier,
enum _lcl_enum_component_t {
_lcl_component(MyTracker, "My.Tracker", "My/Tracker")
_lcl_component_t_count,
_lcl_component_t_first = 0,
_lcl_component_t_last = _lcl_component_t_count-1
};
# undef _lcl_component
Is this a module build?
I'm slightly unsure on what you mean by 'module build', but to clarify; We've integrated the project to be used by one of our own internal pods, so it's a part of that Pod's code.
Integrating it as a Pod itself also didn't work, since it would't compile past needing a lcl_config_components.h
file. After hacking that, it would still not compile due to the compiler error I mentioned.
If the Pod is built as a (clang-style) module, then the macro/include mechanism doesn't work anymore, because includes are only processed once :(
You might want to try the trick that was done in RestKit, they changed the component definition into 1 macro: https://github.com/RestKit/RestKit/blob/development/Code/Support/lcl_config_components_RK.h#L52-L63