2
0
Эх сурвалжийг харах

The MCST Elbrus C Compiler supports __typeof. (#247)

The trick here is that MCST's compiler is also colloquially
known as "LCC", so it defines `__LCC__`; so we'd think it was
the [Retargetable C Compiler](https://drh.github.io/lcc/) and
assume it had no `__typeof`. Check for `__MCST__` before checking
for `__LCC__`.

Thanks to @utf-4096 for the patch!
Arthur O'Dwyer 3 жил өмнө
parent
commit
4d01591ed9
2 өөрчлөгдсөн 4 нэмэгдсэн , 0 устгасан
  1. 2 0
      src/uthash.h
  2. 2 0
      src/utlist.h

+ 2 - 0
src/uthash.h

@@ -51,6 +51,8 @@ typedef unsigned char uint8_t;
 #else                   /* VS2008 or older (or VS2010 in C mode) */
 #define NO_DECLTYPE
 #endif
+#elif defined(__MCST__)  /* Elbrus C Compiler */
+#define DECLTYPE(x) (__typeof(x))
 #elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__)
 #define NO_DECLTYPE
 #else                   /* GNU, Sun and other compilers */

+ 2 - 0
src/utlist.h

@@ -70,6 +70,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #else                   /* VS2008 or older (or VS2010 in C mode) */
 #define NO_DECLTYPE
 #endif
+#elif defined(__MCST__)  /* Elbrus C Compiler */
+#define LDECLTYPE(x) __typeof(x)
 #elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__)
 #define NO_DECLTYPE
 #else                   /* GNU, Sun and other compilers */