Skip to content

Commit

Permalink
[core] Fixed 'undef' warning with gcc and clang (#2131)
Browse files Browse the repository at this point in the history
  • Loading branch information
lelegard authored Sep 20, 2021
1 parent f9a54a0 commit add4058
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion srtcore/platform_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@
#endif
#else

#if __APPLE__
#if defined(__APPLE__) && __APPLE__
// Warning: please keep this test as it is, do not make it
// "#if __APPLE__" or "#ifdef __APPLE__". In applications with
// a strict "no warning policy", "#if __APPLE__" triggers an "undef"
// error. With GCC, an old & never fixed bug prevents muting this
// warning (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431).
// Before this fix, the solution was to "#define __APPLE__ 0" before
// including srt.h. So, don't use "#ifdef __APPLE__" either.

// XXX Check if this condition doesn't require checking of
// also other macros, like TARGET_OS_IOS etc.

Expand Down

0 comments on commit add4058

Please sign in to comment.