Skip to content

Commit c39f4aa

Browse files
Merge pull request #614 from ldorau/Disable_warning_28251_Inconsistent_annotation_for_BitScanForward
Disable warning 28251: Inconsistent annotation for _BitScanForward
2 parents 5913aef + cda61b0 commit c39f4aa

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

src/utils/utils_concurrency.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
#ifdef _WIN32
1616
#include <windows.h>
17+
18+
#include "utils_windows_intrin.h"
19+
20+
#pragma intrinsic(_BitScanForward64)
1721
#else
1822
#include <pthread.h>
1923

src/utils/utils_windows_intrin.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
*
3+
* Copyright (C) 2024 Intel Corporation
4+
*
5+
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
6+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
*
8+
*/
9+
10+
#ifndef UMF_UTILS_WINDOWS_INTRIN_H
11+
#define UMF_UTILS_WINDOWS_INTRIN_H 1
12+
13+
#ifdef _WIN32
14+
15+
// Disable warning 28251: "inconsistent annotation for function" thrown in
16+
// intrin.h, as we do not want to modify this file.
17+
#pragma warning(push)
18+
#pragma warning(disable : 28251)
19+
20+
#include <intrin.h>
21+
22+
#pragma warning(pop)
23+
24+
#endif /* _WIN32 */
25+
26+
#endif /* UMF_UTILS_WINDOWS_INTRIN_H */

src/utils/utils_windows_math.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,7 @@
88
*/
99

1010
#include "utils_math.h"
11-
12-
// disable warning 28251: "inconsistent annotation for function" thrown in
13-
// intrin.h, as we do not want to modify this file
14-
#if defined(_MSC_VER)
15-
#pragma warning(push)
16-
#pragma warning(disable : 28251)
17-
#endif // _MSC_VER
18-
19-
#include <intrin.h>
20-
21-
#if defined(_MSC_VER)
22-
#pragma warning(pop)
23-
#endif // _MSC_VER
11+
#include "utils_windows_intrin.h"
2412

2513
#pragma intrinsic(_BitScanReverse)
2614

0 commit comments

Comments
 (0)