Suppress unused warnings on YGDefaultLog
Summary: Suppresses the unused warnings on ```YGDefaultLog```. It uses a more generic macro which simply casts the variable to ```(void)```. This is the simples approach to make mutiple different compilers happy. Fixes #650 Closes https://github.com/facebook/yoga/pull/651 Differential Revision: D6407999 Pulled By: emilsjolander fbshipit-source-id: 19fd78dd8b84eafdbb48875dd003d506a98c4807
This commit is contained in:
committed by
Facebook Github Bot
parent
dec1172f38
commit
429a7eeee3
@@ -98,11 +98,15 @@ static int YGAndroidLog(const YGConfigRef config,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#define YG_UNUSED(x) (void)(x);
|
||||||
|
|
||||||
static int YGDefaultLog(const YGConfigRef config,
|
static int YGDefaultLog(const YGConfigRef config,
|
||||||
const YGNodeRef node,
|
const YGNodeRef node,
|
||||||
YGLogLevel level,
|
YGLogLevel level,
|
||||||
const char *format,
|
const char *format,
|
||||||
va_list args) {
|
va_list args) {
|
||||||
|
YG_UNUSED(config);
|
||||||
|
YG_UNUSED(node);
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case YGLogLevelError:
|
case YGLogLevelError:
|
||||||
case YGLogLevelFatal:
|
case YGLogLevelFatal:
|
||||||
@@ -115,6 +119,8 @@ static int YGDefaultLog(const YGConfigRef config,
|
|||||||
return vprintf(format, args);
|
return vprintf(format, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef YG_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool YGFloatIsUndefined(const float value) {
|
bool YGFloatIsUndefined(const float value) {
|
||||||
|
Reference in New Issue
Block a user