[SOLVED] #include "mbed.h" for Arduino BLE breaks the build in Visual Studio

While #include "mbed.h" is ok once I compile in Arduino IDE this line breaks the build for Visual Studio Code:

Compiling .pio/build/nano33ble/src/pwm1.c.o
In file included from /Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:27,
                 from /Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed.h:4,
                 from src/pwm1.c:1:
/Users/xxx/.platformio/packages/framework-arduino-mbed/variants/ARDUINO_NANO33BLE/pinmode_arduino.h:48:6: error: conflicting types for 'pinMode'


In file included from /Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:28,
                 from /Users/xxx/.platformio/packages/framework-arduino-mbed/variants/ARDUINO_NANO33BLE/pins_arduino.h:3,
                 from /Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:79,
                 from /Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed.h:4,
                 from src/pwm1.c:1:
/Users/xxx/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:22:10: fatal error: cstdio: No such file or directory
 #include <cstdio>
          ^~~~~~~~
compilation terminated.
*** [.pio/build/nano33ble/src/pwm1.c.o] Error 1

What could be a reason for that? Please advise.

UPDATE Renaming C file to CPP solved the problem.