Skip to content

Commit

Permalink
Avoid using unknown #pragma for non-MSVC compiler in public header fi…
Browse files Browse the repository at this point in the history
…les. (#3890)

Co-authored-by: Ji WenCong <[email protected]>
  • Loading branch information
TaikiAkita and Ji WenCong authored Oct 2, 2023
1 parent c7f8f49 commit b2e1bd8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/inc/msquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Supported Platforms:

#ifdef _WIN32
#pragma once
#endif

#pragma warning(disable:4201) // nonstandard extension used: nameless struct/union
#pragma warning(disable:4214) // nonstandard extension used: bit field types other than int
#endif

#ifdef _KERNEL_MODE
#include "msquic_winkernel.h"
Expand Down
7 changes: 7 additions & 0 deletions src/inc/msquic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Supported Platforms:
--*/

#ifdef _WIN32
#pragma once
#endif

#ifndef _MSQUIC_HPP_
#define _MSQUIC_HPP_

#include "msquic.h"
#include "msquicp.h"
Expand Down Expand Up @@ -1552,3 +1557,5 @@ struct QuicBufferScope {
operator QUIC_BUFFER* () noexcept { return Buffer; }
~QuicBufferScope() noexcept { if (Buffer) { delete[](uint8_t*) Buffer; } }
};

#endif // _WIN32
2 changes: 2 additions & 0 deletions src/inc/msquic_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
--*/

#ifdef _WIN32
#pragma once
#endif

#ifndef _MSQUIC_POSIX_
#define _MSQUIC_POSIX_
Expand Down

0 comments on commit b2e1bd8

Please sign in to comment.