Zapic's Blog
VSCode PlatformIO SDCC存档
2023-07-16
编程

要在VSCode里用PlatformIO配SDCC写东西, 需要一点Polyfill才能让VSCode正常解析C51特有的语法

#if defined(__INTELLISENSE__)
#define __data
#define __near
#define __idata
#define __xdata
#define __far
#define __pdata
#define __code
#define __bit char
#define __sfr volatile unsigned char
#define __sbit volatile char
#define __critical
#define __at(x) /* use "__at (0xab)" instead of "__at 0xab" */
#define __using(x)
#define __interrupt(x)
#define __naked
#define _nop_()

/* The tool Splint is available at http://www.splint.org
   Other tools might also be used for statically checking c-sources.
   Traditionally they could have "lint" in their name.
 */
#if defined(S_SPLINT_S)

/* Behaviour of splint can be modified by special comments.
   Some examples are shown below.

   Note 1: most probably you'll want to copy this complete file into
   your source directory, adapt the settings to your needs and use
   #include "lint.h" as the first include in your source file(s).
   You should then be able to either directly compile your file
   or to run a check with splint over it without other changes.

   Note 2: you need brackets around arguments for special
   keywords, so f.e. it's "interrupt (1)" instead of "interrupt 1".
 */

/*@ +charindex @*/

#endif
#endif