Skip to content

Fix Windows/MSVC build: replace __restrict__ with portable RESTRICT macro - #1

Open
primuszp wants to merge 1 commit into
lewiswan:mainfrom
primuszp:claude/inspiring-ellis-122855
Open

Fix Windows/MSVC build: replace __restrict__ with portable RESTRICT macro#1
primuszp wants to merge 1 commit into
lewiswan:mainfrom
primuszp:claude/inspiring-ellis-122855

Conversation

@primuszp

Copy link
Copy Markdown

Problem

On Windows with MSVC, pip install . fails with 200+ compiler errors:

error C2065: 'vb': undeclared identifier
error C2065: 'M': undeclared identifier

math_fun.h uses __restrict__ (GNU extension, double underscores), which MSVC does not recognize — it only supports __restrict. MSVC fails to parse the pointer declarations, leaving M, vb, Coe, Y, Z undeclared. This is not an issue on macOS (Clang) or Linux (GCC).

Fix

Added an MSVC-aware RESTRICT macro to math_fun.h (identical to the one already in processing_function.h) and replaced all five __restrict__ usages.

Tested

pip install . now succeeds on Windows 11 with MSVC.

…acro

GCC and Clang support the GNU extension __restrict__, but MSVC only
recognizes __restrict (no trailing underscores). On Windows with MSVC,
the double-underscore form caused pointer declarations in math_fun.h to
fail, resulting in 200+ undeclared identifier errors. This is not an
issue on macOS (Clang) or Linux (GCC).

Added an MSVC-aware RESTRICT macro (matching the one already present in
processing_function.h) and replaced all __restrict__ usages in math_fun.h.
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.

1 participant