Fix: Avoid windows.h min/max macro definition in BLI_winstuff.h #108471
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#108471
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "guishe/blender:expected-type"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When moving io_allembic to c++, the compiler would throw the error
type "unknown-type" unexpected
.Here the compiler output
Hey, are you sure is that is really caused by template parametr?
I was get same errors due to macros leak from
windows.h
.Fix : Add missign type specificationto Cleanup: Add missing template argumentYou're right!
Specifying the template parameter removes the ambiguity.
Another solution is to use
And we could remove the template argument specification that was made in other lines in the same files
Do you have a repro to get the error? I'd like to take a closer look what's happening there
You should probably start a PR so that others can see it. As a result of my attempts to get around the leak, I realized that it's easier to just create a new C++ file.
Here the pr #108477
The error comes when moving
io_allembic
to .ccWith this uncommented also compile
That's a Band-Aid, not a fix, all inclusions that lead to
windows.h
being included, have been guarded with the appropriate macro's to preventwindows.h
from defining min/max.What needs to be done here is find who/what drags in windows.h and put these same guards around that.
If you want, you can continue my attempt
7d1e58f12b
(i was get error in index range actually)3830316c4f
to8e6a1b9e3e
Was the
#include <windows.h>
onBLI_winstuff.h
Cleanup: Add missing template argumentto Fix: Avoid windows.h min/max macro specification in BLI_winstuff.hI modified the patch to avoid including the macros by doing
#include <windows.h>
inBLI_winstuff.h
@mod_moder I took a look, its the same fix needed in
7d1e58f12b
Fix: Avoid windows.h min/max macro specification in BLI_winstuff.hto Fix: Avoid windows.h min/max macro definition in BLI_winstuff.h@ -17,6 +17,10 @@
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
this has to be done the same way as I linked, including cleanup
@ -54,3 +58,3 @@
# define W_OK 2
/* Not accepted by `access()` on windows. */
//# define X_OK 1
// # define X_OK 1
unintended whitespace change?
8e6a1b9e3e
toef6b5db997
@ -18,3 +18,3 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(WIN32) && !defined(NOMINMAX)
defined(WIN32)
It ends up being redundant becauseBLI_winstuff.h
should only be imported on windows I thinkthere's a check that errors if it's not WIN32 a few lines above that , so
defined(WIN32)
this can be safely removed.Done!
lgtm , @JacquesLucke feel free to land, I didn't want to land it and go awol for 8+ hours
At first it seemed to me to be Jacques scope (templates and containers of bli), but when it turned out to be the Dodo's scope, it turned out that I could not delete the reviewer