Spritetm / libesphttpd

NOTE: THIS CODE IS UNMAINTAINED. Please take a look at https://github.com/chmorgan/libesphttpd instead.
125 stars 109 forks source link

Type definitions on SDK 2.0.0 #32

Open iia opened 7 years ago

iia commented 7 years ago

When trying to compile libesphttpd using ESP8266 SDK 2.0.0 data type related error such as,

../esp-open-sdk/sdk//include/ets_sys.h:31:1: error: unknown type name 'uint32_t' typedef uint32_t ETSSignal;

are reported. It seems like in SDK 2.0.0 they changed type definitions which causes this problem.

The following patch on the file located at /include/c_types.h seems to fix these issues.

--- ./c_types.h
+++ ./c_types.h
@@ -8,17 +8,17 @@

 #include <stdint.h>
 #include <stdbool.h>
-//typedef unsigned char       uint8_t;
+typedef unsigned char       uint8_t;
 typedef signed char         sint8_t;
-//typedef signed char         int8_t;
-//typedef unsigned short      uint16_t;
+typedef signed char         int8_t;
+typedef unsigned short      uint16_t;
 typedef signed short        sint16_t;
-//typedef signed short        int16_t;
-//typedef unsigned int        uint32_t;
+typedef signed short        int16_t;
+typedef unsigned int        uint32_t;
 typedef signed long         sint32_t;
-//typedef signed int          int32_t;
+typedef signed int          int32_t;
 typedef signed long long    sint64_t;
-//typedef unsigned long long  uint64_t;
+typedef unsigned long long  uint64_t;
 typedef unsigned long long  u_int64_t;
 typedef float               real32_t;
 typedef double              real64_t;

It would be nice to have this issue fixed in libesphttpd.

valkuc commented 7 years ago

As I see there is present definition for uint32_t in SDK 2.0.0 c_types.h Furthermore, I have switched from SDK 1.5.4 to 2.0.0 without any issues in libesphttpd. Your c_types.h looks like not from SDK 2.0.0

jacmet commented 7 years ago

@iia looks like you forgot to pass USE_OPENSDK=yes, otherwise libesphttpd passes -D_STDINT_H which causes stdint.h to get ignored

jacmet commented 7 years ago

@iia FYI, I've recently submitted a fix for building against 2.x SDKs: https://github.com/Spritetm/libesphttpd/pull/39