[core] explicitly include sys/cdefs.h
<sys/cdefs.h> might not be included in standard headers by musl libc
x-ref:
#include <sys/types.h>
#include <stddef.h>
+#ifdef __has_include
+#if __has_include(<sys/cdefs.h>)
+#include <sys/cdefs.h>
+#endif
+#endif
+
#ifndef __BEGIN_DECLS
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {
