You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include error because of unwanted macro which is not possible to undefine #11479
I am writing an extension to support tool-chain which is cross compiling for another os. I.e. its not windows, linux or mac.
The problem is there is always error which is coming from system includes because its trips on __linux__ which expand
code segment to to something which cannot be found. My compiler does not define it, but unfortunately default intelliSenseMode mode does and there is no way to undefine it via configuration
Proposed solutions (one of):
provide intelliSenseMode NOT bound to host, i.e. other-gcc-x86 (etc) which does not define __linux__, max or windows macros
provide intelliSenseMode common which does not define ANY additional defines (since it already exists maybe just allowing this to be used as value would solve this)
provide "undefines" along "defines" in the c_cpp_properties
allow "defines" to undefine vars some-how, i.e. !__linux__
Bad workarounds:
Set intelliSenseMode to other value, i.e. windows on linux - that did not work: For C source files, IntelliSenseMode was changed from "windows-gcc-x64" to "linux-gcc-x64" based on compiler args and querying compilerPath: "/host/linux/x86_64/usr/bin/q++"
Create undef.h, write #undef __linux__ in there and use forcedInclude - that is super ugly because I would either have to generate this file in every project or in some common area with limited way to refer to this file c_cpp_properties without full path
Configuration and Logs
Can reproduce with this fake program, I want a way to make it not error out (running on linux host), since my compiler does not define this macro
Alena Laskavaia (@elaskavaia)
Thank you for reporting this issue. We determined it is a duplicate of #4653 (please up-vote to increase its priority), which is supposed to address various platform/architecture/compiler features that impact defines or headers or IntelliSense configs based on IntelliSense mode.
Activity
michelleangela commentedon Sep 29, 2023
Alena Laskavaia (@elaskavaia)
Thank you for reporting this issue. We determined it is a duplicate of #4653 (please up-vote to increase its priority), which is supposed to address various platform/architecture/compiler features that impact defines or headers or IntelliSense configs based on IntelliSense mode.