Skip to content

Commit

Permalink
Suppress unused warnings on YGDefaultLog
Browse files Browse the repository at this point in the history
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 facebook/yoga#651

Differential Revision: D6407999

Pulled By: emilsjolander

fbshipit-source-id: 19fd78dd8b84eafdbb48875dd003d506a98c4807
  • Loading branch information
woehrl01 authored and facebook-github-bot committed Nov 28, 2017
1 parent ae51730 commit 72e762d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ static int YGAndroidLog(const YGConfigRef config,
return result;
}
#else
#define YG_UNUSED(x) (void)(x);

static int YGDefaultLog(const YGConfigRef config,
const YGNodeRef node,
YGLogLevel level,
const char *format,
va_list args) {
YG_UNUSED(config);
YG_UNUSED(node);
switch (level) {
case YGLogLevelError:
case YGLogLevelFatal:
Expand All @@ -115,6 +119,8 @@ static int YGDefaultLog(const YGConfigRef config,
return vprintf(format, args);
}
}

#undef YG_UNUSED
#endif

bool YGFloatIsUndefined(const float value) {
Expand Down

0 comments on commit 72e762d

Please sign in to comment.