aboutsummaryrefslogtreecommitdiff
path: root/src/common/common_funcs.h
Commit message (Collapse)AuthorAgeFilesLines
* [common] rework BitField and BitUtil, use concepts whenever possible (#4076)lizzie2026-07-091-39/+33
| | | | | | | | | | test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [common] Do not expose platform specific Crash() macro that is only used ↵lizzie2025-11-031-21/+3
| | | | | | | | | | | | | | | | ever once (#2909) thing is only ever used once and its also platform specific... uh Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2909 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common] Common::Size -> std::size (#2910)lizzie2025-10-311-15/+0
| | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2910 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common, hle/kernel] Remove LTO_NOINLINE (#2908)lizzie2025-10-311-4/+3
| | | | | | | | | | | | | - Dont just tell the compiler what to inline/what not to inline; the compiler will be pissed off and make bad codegen Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2908 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Make system settings persistent across bootsKelebek12023-12-161-0/+6
|
* kernel: mark TLS accessors as noinline for non-MSVC LTOLiam2023-10-121-0/+4
|
* Initial ARM64 supportLiam2022-11-091-1/+3
|
* common_funcs: Mark padding as [[maybe_unused]]Merry2022-07-151-4/+6
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* common_funcs: Add enum flag bitwise shift operator overloadsMorph2021-09-131-0/+16
| | | | This adds bitwise shift operator overloads (<<, >>, <<=, >>=) in the macro DECLARE_ENUM_FLAG_OPERATORS(type)
* common_funcs: Replace <algorithm> with <iterator>Morph2021-09-111-1/+1
|
* common: Move error handling to error.cpp/hMorph2021-09-111-11/+0
| | | | This allows us to avoid implicitly including <string> every time common_funcs.h is included.
* common_funcs: Move R_ macros to result.hLioncash2021-05-311-25/+0
| | | | | | These macros all interact with the result code type, so they should ideally be within this file as well, so all the common_funcs machinery doesn't need to be pulled in just to use them.
* common: Rename NON_COPYABLE/NON_MOVABLE with YUZU_ prefix.bunnei2021-05-051-2/+2
|
* common: common_funcs: Add Size helper function.bunnei2021-05-051-0/+15
|
* common: common_funcs: Add helper macros for non-copyable and non-moveable.bunnei2021-05-051-0/+8
| | | | - Useful for scenarios where we do not want to inherit from NonCopyable.
* [network] Error handling reformcomex2021-02-281-1/+5
| | | | | | | | | | | | | | | | | | | | | `network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
* common: common_funcs: Change R_UNLESS to LOG_ERROR.bunnei2021-01-281-1/+1
|
* common: common_funcs: Log error on R_UNLESS.bunnei2021-01-281-0/+3
|
* common: common_funcs: Add useful kernel macro R_SUCCEED_IF.bunnei2021-01-281-0/+3
|
* common: common_funcs: Add a few more useful macros for kernel code.bunnei2021-01-281-0/+11
|
* common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINITReinUsesLisp2021-01-151-4/+4
| | | | INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
* common: common_funcs: Add R_UNLESS macro.bunnei2021-01-111-0/+8
|
* common_funcs: Add missing XOR operators to DECLARE_ENUM_FLAG_OPERATORSLioncash2020-08-241-4/+10
| | | | | Ensures that the full set of bitwise operators are available for types that make use of this macro.
* common: Make use of [[nodiscard]] where applicableLioncash2020-08-151-7/+7
| | | | | | Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
* common: common_funcs: Add a macro for defining enum flag operators.bunnei2020-04-171-0/+32
|
* common_funcs: Remove semicolons from INSERT_PADDING_* macrosLioncash2019-11-141-4/+6
| | | | | Makes code that uses the macros consistent by requiring the lines to be terminated with a semicolon.
* common_funcs: silence sign-conversion warnings in MakeMagic()Lioncash2019-11-131-1/+1
| | | | | We can trivially resolve these by casting the characters to unsigned values and then shifting the bits.
* common_func: Use std::array for INSERT_PADDING_* macros.bunnei2019-11-031-12/+10
| | | | - Zero initialization here is useful for determinism.
* Revert "common_func: Use std::array for INSERT_PADDING_* macros."bunnei2019-11-031-3/+2
|
* common_func: Use std::array for INSERT_PADDING_* macros.bunnei2019-11-031-2/+3
| | | | - Zero initialization here is useful for determinism.
* texture_cache: Address FeedbackFernando Sahmkow2019-07-051-10/+0
|
* Reduce amount of size calculations.Fernando Sahmkow2019-06-201-0/+11
|
* Port #3732 from Citra: "common: Fix compilation on ARM"Cameron Cawley2018-07-291-3/+1
|
* Merge pull request #710 from lioncash/unusedbunnei2018-07-191-38/+0
|\ | | | | common/common_funcs: Remove unused rotation functions
| * common/common_funcs: Remove unused rotation functionsLioncash2018-07-191-38/+0
| | | | | | | | | | | | | | These are unused and essentially don't provide much benefit either. If we ever need rotation functions, these can be introduced in a way that they don't sit in a common_* header and require a bunch of ifdefing to simply be available
* | common/misc: Deduplicate code in GetLastErrorMsg()Lioncash2018-07-191-1/+3
|/ | | | | | | Android and macOS have supported thread_local for quite a while, but most importantly is that we don't even really need it. Instead of using a thread-local buffer, we can just return a non-static buffer as a std::string, avoiding the need for that quality entirely.
* Port #3579 from CitrafearlessTobi2018-07-071-2/+2
|
* Merge pull request #362 from lioncash/snprintfbunnei2018-04-201-5/+0
|\ | | | | common_funcs: Remove check for VS versions that we don't even support
| * common_funcs: Remove check for VS versions that we don't even supportLioncash2018-04-191-5/+0
| | | | | | | | | | We don't support any VS versions that don't already have snprintf in the standard library implementation.
* | common_funcs: Remove ARRAY_SIZE macroLioncash2018-04-191-2/+0
|/ | | | C++17 has non-member size() which we can just call where necessary.
* core: Refactor MakeMagic usage and remove dead code.bunnei2017-10-151-0/+8
|
* Common: Fix some out-of-style includesYuri Kunde Schlesner2017-05-271-1/+1
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-1/+0
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner2016-09-181-2/+1
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-11/+14
|
* common_funcs: Provide rotr and rotl for MSVCMerryMage2016-05-271-12/+18
|
* VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot2016-04-301-0/+4
|
* Common: Get rid of alignment macrosLioncash2016-03-091-9/+1
| | | | | The gl rasterizer already uses alignas, so we may as well move everything over.
* Fix building under MinGWdarkf2015-08-171-3/+9
|