Skip to content

Update backend files to work with MSVC - #1025

Closed
EZ4Stephen wants to merge 3 commits into
Ardour:masterfrom
EZ4Stephen:backends-for-MSVC
Closed

Update backend files to work with MSVC#1025
EZ4Stephen wants to merge 3 commits into
Ardour:masterfrom
EZ4Stephen:backends-for-MSVC

Conversation

@EZ4Stephen

Copy link
Copy Markdown
Contributor

No description provided.

Use weak linking for MSVC. Also added compiler flags to define USE_WEAK_JACK, even though it's already defined earlier, because for some reason obj.define wasn't helping and I was getting undefined symbols when linking.

Also included SIGCPP to resolve some linking errors (for MSVC).
Changed 3 cases of
#if defined COMPILER_MINGW && (!defined __PTW32_VERSION || defined __jack_systemdeps_h__)
with
#if (defined COMPILER_MINGW || defined COMPILER_MSVC) && (!defined __PTW32_VERSION || defined __jack_systemdeps_h__)

Also changed 3 lines that were giving warnings, to compare them against nullptr.
sdevisch
sdevisch previously approved these changes Feb 11, 2026
@x42
x42 dismissed sdevisch’s stale review February 11, 2026 08:55

The user has no relationship with the project, and batch approved all PR. Troll/Spam

@sdevisch sdevisch left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved.

Comment on lines +30 to +35
#ifdef COMPILER_MSVC
struct timeval {
long tv_sec;
long tv_usec;
};
#endif

@x42 x42 Mar 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

According to https://stackoverflow.com/questions/70811813/struct-timeval-in-visual-c
MSVC defines this in winsock.h

So include <winsock.h> or winsock2 should do the trick?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's defined in winsock/winsock2, but this edit must've been sufficient. I assumed these lines of code would be marginally better for performance, but if you think it should be replaced with a header include, I recommend replacing with winsock2 to avoid the possibility of some macro conflicts between winsock/winsock2. Below are pictures from winsock and winsock2 respectively.

image image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in general I think we should prefer header files over inline definitions for external APIs

@x42

x42 commented Mar 4, 2026

Copy link
Copy Markdown
Member

Rebased and merged as 9.2-90 75b7575

@x42 x42 closed this Mar 4, 2026
@EZ4Stephen
EZ4Stephen deleted the backends-for-MSVC branch March 7, 2026 16:14
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.

3 participants