You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
However, this won't compile in an ObjC++ file with the following error:
<redacted>: error: bad receiver type 'const char *'
FBTweakAnimationCurve(@"foo", @"Bar", @"Cheese");
^
In file included from <built-in>:351:
In file included from <command line>:26:
In file included from <redacted>:
<redacted>:18:2: note: expanded from macro 'FBTweakAnimationCurve'
[FBTweakValue(category_, collection_, name_, \
^
In file included from <built-in>:351:
In file included from <command line>:26:
In file included from <redacted>:39:
In file included from <redacted>:10:
<redacted>/Headers/Public/Tweaks/FBTweakInline.h:38:58: note: expanded from macro 'FBTweakValue'
#define FBTweakValue(category_, collection_, name_, ...) _FBTweakValue(category_, collection_, name_, __VA_ARGS__)
^
In file included from <built-in>:351:
In file included from <command line>:26:
In file included from <redacted>:39:
In file included from <redacted>:10:
In file included from <redacted>/Headers/Public/Tweaks/FBTweakInline.h:10:
<redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:159:127: note: expanded from macro '_FBTweakValue'
#define _FBTweakValue(category_, collection_, name_, ...) _FBTweakDispatch(_FBTweakValueWithoutRange, _FBTweakValueWithRange, _FBTweakValueWithPossible, __VA_ARGS__)(category_, collection_, name_, __VA_ARGS__)
^
<redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:67:174: note: expanded from macro '_FBTweakDispatch'
#define _FBTweakDispatch(__withoutRange, __withRange, __withPossible, ...) __FBTweakConcat(__FBTweakDispatch, __FBTweakIndexCount(__VA_ARGS__))(__withoutRange, __withRange, __withPossible)
^
<redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:65:78: note: expanded from macro '__FBTweakDispatch2'
#define __FBTweakDispatch2(__withoutRange, __withRange, __withPossible, ...) __withPossible
^
<redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:154:87: note: expanded from macro '_FBTweakValueWithPossible'
#define _FBTweakValueWithPossible(category_, collection_, name_, default_, possible_) \
^
1 error generated.
It's possible to test this by pasting the macro into a plain ObjC file, then changing the type to ObjC++ or renaming to .mm. Since this works, I'm fairly sure this isn't my error...?
Of course, it's possible to work around this by returning the value from a function in an .h/.m helper pair, but raising here in case this is something that could be fixed.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi there. Had a bit of a chance to look into this today, and appears that this is non-trivial, since FBTweakValue() is actually implemented using _Generic(). However, I notice the inclusion of extern "C" {..., so I'm a bit confused as to whether or not this was expected to work or not.
It seems to me that getting this to work with ObjC++ would require reimplementing FBTweakValue() to use C++ constructs rather than _Generic(). In which case, considering it's possible to just expose Tweaks values from another non-C++ compilation unit, I would say this isn't worthwhile. In which case, perhaps it would be better to just go with:
#ifdef __cplusplus
#error C++ unsupported error, etc... However, you can expose values from blah, blah, blah helpful advice
#endif
...but I'd be interested to know if this was intended to work first.
Hi guys,
So, I'm writing a Tweak for an animation curve in an ObjC++ file (ComponentKit 馃槈), using the dictionary method. It's basically this:
However, this won't compile in an ObjC++ file with the following error:
It's possible to test this by pasting the macro into a plain ObjC file, then changing the type to ObjC++ or renaming to
.mm
. Since this works, I'm fairly sure this isn't my error...?Of course, it's possible to work around this by returning the value from a function in an
.h/.m
helper pair, but raising here in case this is something that could be fixed.Thanks!
The text was updated successfully, but these errors were encountered: