Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Stop using std::mutex on Windows builds. #1623

Merged
merged 1 commit into from
May 26, 2019
Merged

Conversation

davidgfnet
Copy link
Contributor

Reworked the threading code to an oslib and fixed some use of it.
Had to add windows.h includes and some other minor refactor since
some file were relaying on that header being already included.
While we are at it replace min/max functions with std:: ones.
Seems that we were using the windef.h defined macros (and no idea
where they come from in Linux, which sounds scary to me).

Reworked the threading code to an oslib and fixed some use of it.
Had to add windows.h includes and some other minor refactor since
some file were relaying on that header being already included.
While we are at it replace min/max functions with std:: ones.
Seems that we were using the windef.h defined macros (and no idea
where they come from in Linux, which sounds scary to me).
@@ -1125,18 +1125,18 @@ struct maple_sega_purupuru : maple_base
INC = 0;
bool CNT = VIBSET & 1;

float power = min((POW_POS + POW_NEG) / 7.0, 1.0);
Copy link
Owner

Choose a reason for hiding this comment

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

In general, we have the habit of importing std for common functions like min. Too lazy to typestd::bs all the time

Copy link
Owner

@skmp skmp left a comment

Choose a reason for hiding this comment

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

Looks good, minus the std:: usage. But I'm flexible.

@davidgfnet
Copy link
Contributor Author

Just wanna avoid using some random min/max macro that depends on some windows header, which is fragile if a header changes due to some refactor. We can later decide to use "using std::min/max" and be done with it for easy reading. Thanks!

{
pthread_mutex_lock( &mutx );
state=true;
pthread_cond_signal( &cond);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: align

@@ -251,12 +251,10 @@ else ifneq (,$(findstring vero4k,$(platform)))
# Windows
else ifneq (,$(findstring win32,$(platform)))
NOT_ARM := 1
CFLAGS += -DTARGET_NO_WEBUI -fno-builtin-sqrtf -funroll-loops -DHAVE_FSEEKO -D TARGET_NO_AREC
CFLAGS += -DNOMINMAX -DTARGET_NO_WEBUI -fno-builtin-sqrtf -funroll-loops -DHAVE_FSEEKO -D TARGET_NO_AREC
Copy link
Contributor

Choose a reason for hiding this comment

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

Also please add to cmake build.

@davidgfnet davidgfnet merged commit f1b3678 into skmp:master May 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants