Skip to content

Commit e9b7b07

Browse files
committed
Visual C++ language extensions use "generic" as a keyword. Add a
workaround that renames the namespace to "cpp_generic" when those language extensions are in effect.
1 parent 308c775 commit e9b7b07

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

asio/include/asio/detail/pop_options.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,11 @@
9595
# pragma warning (pop)
9696
# pragma pack (pop)
9797

98+
# if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
99+
# if defined(ASIO_CLR_WORKAROUND)
100+
# undef generic
101+
# undef ASIO_CLR_WORKAROUND
102+
# endif
103+
# endif
104+
98105
#endif

asio/include/asio/detail/push_options.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,13 @@
124124
# error Multithreaded RTL must be selected.
125125
# endif // !defined(_MT)
126126

127+
# if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
128+
# if !defined(ASIO_DISABLE_CLR_WORKAROUND)
129+
# if !defined(generic)
130+
# define generic cpp_generic
131+
# define ASIO_CLR_WORKAROUND
132+
# endif
133+
# endif
134+
# endif
135+
127136
#endif

0 commit comments

Comments
 (0)