Skip to content

Commit

Permalink
WinPR: don't warn about thread-local storage on iOS, add comment bann…
Browse files Browse the repository at this point in the history
…ing its use for new code
  • Loading branch information
Marc-André Moreau authored and akallabeth committed May 28, 2021
1 parent 8e43f90 commit 73a931f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions winpr/include/winpr/winpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#define WINPR_DEPRECATED(obj) obj
#endif

/* Thread local storage keyword define */
// WARNING: *do not* use thread-local storage for new code because it is not portable
// It is only used for VirtualChannelInit, and all FreeRDP channels use VirtualChannelInitEx
// The old virtual channel API is only realistically used on Windows where TLS is available
#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define WINPR_TLS __thread
Expand All @@ -65,8 +67,8 @@
#elif !defined(__IOS__)
#define WINPR_TLS __thread
#else
#warning "Target iOS does not support Thread Local Storage!"
#warning "Multi Instance support is disabled!"
// thread-local storage is not supported on iOS
// don't warn because it isn't actually used on iOS
#define WINPR_TLS
#endif

Expand Down

0 comments on commit 73a931f

Please sign in to comment.