Skip to content

Commit c3e6e3f

Browse files
authored
Merge pull request #7 from srogatch/users/srogatch/fix/C++20
Fix the compilation for C++20
2 parents fb9b8fe + 61327b5 commit c3e6e3f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/tbprobe.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ SOFTWARE.
3939
#endif
4040
#include "tbprobe.h"
4141

42-
#ifdef __cplusplus
43-
using namespace std;
44-
#endif
45-
4642
#define TB_PIECES 7
4743
#define TB_HASHBITS (TB_PIECES < 7 ? 11 : 12)
4844
#define TB_MAX_PIECE (TB_PIECES < 7 ? 254 : 650)
@@ -70,6 +66,13 @@ typedef size_t map_t;
7066
typedef HANDLE map_t;
7167
#endif
7268

69+
// This must be after the inclusion of Windows headers, because otherwise
70+
// std::byte conflicts with "byte" in rpcndr.h . The error occurs if C++
71+
// standard is at lest 17, as std::byte was introduced in C++17.
72+
#ifdef __cplusplus
73+
using namespace std;
74+
#endif
75+
7376
#define DECOMP64
7477

7578
// Threading support

0 commit comments

Comments
 (0)