VS Code with QNX Toolkit
Using the VS Code with QNX Toolkit, you can control the preprocessor macros used by the C/C++ extension by
creating a header file containing #define
and #undef
directives.
In the Visual Studio Code settings, search for "Forced Include" and specify the path to the header file. This file will be automatically included in all C/C++ source files.
If you provide an absolute path, it applies to all files globally.
To make the header workspace-specific, use the following path:
${workspaceFolder}/vscode-preinclude.h
Example content:
#undef __linux__
#define __QNX__ 800
#define __unix__
If you only want to add new preprocessor variables, you can search for "Defines" in the Visual Studio Code settings and add them under C_Cpp > Default: Defines.
Page updated: