BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fatal error: stdint.h: No such file or directory

larsonmars opened this issue · comments

Hello,

I am trying to port some libraries, but found that including stdint.h fails, although STDC_VERSION is defined to be at least 199901L.
The library provides its own stdint types, but uses <stdint.h> if available. It tests availability like this:

#if __STDC_VERSION__ >= 199901L
#include <stdint.h>
#endif

However, it seems that doing so includes %USERPROFILE%.vscode\extensions\bartmanabyss.amiga-debug-1.7.1\bin\win32\opt\lib\gcc\m68k-amiga-elf\12.2.0\include\stdint.h which looks like this:

#ifndef _GCC_WRAP_STDINT_H
#if __STDC_HOSTED__
# if defined __cplusplus && __cplusplus >= 201103L
#  undef __STDC_LIMIT_MACROS
#  define __STDC_LIMIT_MACROS
#  undef __STDC_CONSTANT_MACROS
#  define __STDC_CONSTANT_MACROS
# endif
# include_next <stdint.h>
#else
# include "stdint-gcc.h"
#endif
#define _GCC_WRAP_STDINT_H
#endif

The line # include_next <stdint.h> causes the error.

A work around is to redefine STDC_HOSTED to 0, so it will include stdint-gcc.h. I don't know if this is intended, though.

Hi,
yes, there isn't really any std library compatibility here, so you will have to use your workaround.

Isn't this just solvable by adding -ffreestanding?