libretro / libretro/libretro-common
add more missing `round` defines for compat/msvc.h
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 180
- Forks
- 98
- Avg merge
- 7h 16m
- Merged PRs (30d)
- 1
Description
Earlier MSVCs are missing some math.h functions that other compilers have. There is already a #define for roundf in msvc.h that works around one of the missing round functions.
I thought I was going to need one or two more round functions so I drafted two additions, but it turns out I do not have a use case at the moment to test these with. For now I'm including the existing roundf define below for reference, along the two new drafts.
#define roundf(in) (in >= 0.0f ? floorf(in + 0.5f) : ceilf(in - 0.5f))
#define roundd(in) (in >= 0.0 ? floor(in + 0.5) : ceil(in - 0.5))
#define roundl(in) (in >= 0.0 ? floor(in + 0.5) : ceil(in - 0.5))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in compat/msvc.h by reading the existing roundf workaround and compare it with the proposed roundd and roundl definitions. Check whether these functions are missing in the targeted earlier MSVC versions, then verify the compatibility build; done means the needed defines are present without breaking supported builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100