Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloading the set_thread_affinity method for Windows compatibility #193

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SENAI-GilmarCorreia
Copy link
Contributor

@SENAI-GilmarCorreia SENAI-GilmarCorreia commented Nov 12, 2024

Just me and my Windows setup again :)

@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.97%. Comparing base (c0d6b2b) to head (e1a1ee6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #193   +/-   ##
=======================================
  Coverage   72.97%   72.97%           
=======================================
  Files           8        8           
  Lines         396      396           
  Branches       65       65           
=======================================
  Hits          289      289           
  Misses         68       68           
  Partials       39       39           
Flag Coverage Δ
unittests 72.97% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/realtime_helpers.cpp 37.34% <100.00%> (ø)

src/realtime_helpers.cpp Outdated Show resolved Hide resolved
@saikishor
Copy link
Member

@SENAI-GilmarCorreia Do you mind if I push some changes to your branch?

@SENAI-GilmarCorreia
Copy link
Contributor Author

No problem! @saikishor

@saikishor
Copy link
Member

@SENAI-GilmarCorreia I've fixed and opened a PR: SENAI-GilmarCorreia#1. If it looks good to you, please merge it

@SENAI-GilmarCorreia
Copy link
Contributor Author

@saikishor Done!

@saikishor
Copy link
Member

@saikishor Done!

@SENAI-GilmarCorreia There are some failing builds already, can you check?

@SENAI-GilmarCorreia
Copy link
Contributor Author

@saikishor I've just fixed the issue by using the __unix__ flag instead of UNIX, which wasn't defined correctly for non-Windows environments.

#ifdef _WIN32
#include <windows.h>
#else
#ifdef __unix__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know which platforms we end up targeting or want to support, but just leaving some text here to ruminate on:

However, compilers for OSX, iOS, and Darwin do not define __unix__. To detect all BSD OSes, including OSX, iOS, and Darwin, use an #if/#endif that checks for __unix__ along with __APPLE__ and __MACH__ (see the later section on OSX and iOS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants