fix(printf) use __has_include for more accurate limits information
This makes LV_PRId32 more reliable and less prone to type mismatch.
#ifndef _LV_PRINTF_H_
#define _LV_PRINTF_H_
-/* not all compilers provide inttypes.h which would define these */
-#include<limits.h>
-
-#if LONG_MAX==2147483647
- #define LV_PRId32 "ld"
+#if defined(__has_include) && __has_include(<inttypes.h>)
+ #include<inttypes.h>
+ /* platform-specific printf format for int32_t, usually "d" or "ld" */
+ #define LV_PRId32 PRId32
#else
+ /* hope this is correct for ports without __has_include or without inttypes.h */
#define LV_PRId32 "d"
#endif
