• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisión30c3a4c7e7187f6620a32727fdaf4945414ad5df (tree)
Tiempo2017-04-02 10:30:47
Autors.gusarov
Commiters.gusarov

Log Message

predef/library.h: Added definition of CT_LIBC_UCLIBC_VERSION

Cambiar Resumen

Diferencia incremental

diff -r 3d06a356edd7 -r 30c3a4c7e718 include/ctools/predef/library.h
--- a/include/ctools/predef/library.h Sun Apr 02 04:29:50 2017 +0300
+++ b/include/ctools/predef/library.h Sun Apr 02 04:30:47 2017 +0300
@@ -83,6 +83,17 @@
8383
8484 #if defined (__UCLIBC__)
8585 # define CT_LIBC_UCLIBC
86+
87+/*
88+ * CT_LIBC_UCLIBC_VERSION can be used in this situation:
89+ * #if CT_LIBC_UCLIBC_VERSION >= 929 that means "if uclibc has version greater or equal to 0.9.29"
90+ */
91+# if defined (__UCLIBC_MAJOR__) && defined (__UCLIBC_MINOR__) && defined (__UCLIBC_SUBLEVEL__)
92+# define CT_LIBC_UCLIBC_VERSION (((__UCLIBC_MAJOR__) * 10000) + (__UCLIBC_MINOR__) * 100 + (__UCLIBC_SUBLEVEL__))
93+# else
94+# define CT_LIBC_UCLIBC_VERSION (0)
95+# endif
96+
8697 #elif defined (__GLIBC__)
8798 # define CT_LIBC_GLIBC
8899 #elif defined (__MSVCRT__)
diff -r 3d06a356edd7 -r 30c3a4c7e718 tests/src/predef/test_library.c
--- a/tests/src/predef/test_library.c Sun Apr 02 04:29:50 2017 +0300
+++ b/tests/src/predef/test_library.c Sun Apr 02 04:30:47 2017 +0300
@@ -27,6 +27,9 @@
2727 {
2828 #if defined (CT_LIBC_UCLIBC)
2929 int a = 1;
30+ int b = CT_LIBC_UCLIBC_VERSION;
31+
32+ CT_UNUSED(b);
3033 #elif defined (CT_LIBC_GLIBC)
3134 int a = 2;
3235 #elif defined (CT_LIBC_MINGW)
Show on old repository browser