forked from roc-streaming/roc-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip] draft-292: Minimal mingw build
- Loading branch information
Showing
5 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/internal_modules/roc_core/target_windows/roc_core/cpu_instructions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024 Roc Streaming authors | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
//! @file roc_core/target_windows/roc_core/cpu_instructions.h | ||
//! @brief CPU-specific instructions. | ||
|
||
#ifndef ROC_CORE_CPU_INSTRUCTIONS_H_ | ||
#define ROC_CORE_CPU_INSTRUCTIONS_H_ | ||
|
||
#include "roc_core/stddefs.h" | ||
|
||
namespace roc { | ||
namespace core { | ||
|
||
//! CPU pause instruction. | ||
//! @remarks | ||
//! Doesn't include any memory barriers, so the caller is responsible to | ||
//! insert them into the loop. Allowed to expand to nothing. | ||
inline void cpu_relax() { | ||
YieldProcessor(); | ||
} | ||
|
||
} // namespace core | ||
} // namespace roc | ||
|
||
#endif // ROC_CORE_CPU_INSTRUCTIONS_H_ |
33 changes: 33 additions & 0 deletions
33
src/internal_modules/roc_core/target_windows/roc_core/cpu_traits.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Roc Streaming authors | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
//! @file roc_core/target_windows/roc_core/cpu_traits.h | ||
//! @brief CPU traits. | ||
|
||
#ifndef ROC_CORE_CPU_TRAITS_H_ | ||
#define ROC_CORE_CPU_TRAITS_H_ | ||
|
||
#include "roc_core/stddefs.h" | ||
|
||
//! Values of ROC_CPU_ENDIAN indicating little- or big-endian CPU. | ||
#define ROC_CPU_BE 1 | ||
#define ROC_CPU_LE 2 | ||
|
||
// CPU endianess. | ||
// Assume that windows always runs on little-endian. | ||
#define ROC_CPU_ENDIAN ROC_CPU_LE | ||
|
||
// Detect CPU bitness. | ||
|
||
#ifdef _WIN64 | ||
#define ROC_CPU_BITS 64 | ||
#else | ||
#define ROC_CPU_BITS 32 | ||
#endif | ||
|
||
#endif // ROC_CORE_CPU_TRAITS_H_ |
32 changes: 32 additions & 0 deletions
32
src/internal_modules/roc_core/target_windows/roc_core/stddefs.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2024 Roc Streaming authors | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
//! @file roc_core/target_windows/roc_core/stddefs.h | ||
//! @brief Commonly used types and functions. | ||
|
||
#ifndef ROC_CORE_STDDEFS_H_ | ||
#define ROC_CORE_STDDEFS_H_ | ||
|
||
#include <algorithm> | ||
#include <cctype> | ||
#include <climits> | ||
#include <cmath> | ||
#include <cstdarg> | ||
#include <cstddef> | ||
#include <ctime> | ||
#include <new> | ||
|
||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include <windows.h> | ||
#include <winnt.h> | ||
|
||
#endif // ROC_CORE_STDDEFS_H_ |