]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/infra/v2_0/include/cyg_type.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / infra / v2_0 / include / cyg_type.h
index f375687c5b0241dedd875f42fbc925c1f6e85835..86bba080ba7fb0aa985faa0c25b2f57ac698eee5 100644 (file)
@@ -250,6 +250,11 @@ typedef cyg_uint64  CYG_WORD64;
 typedef cyg_haladdress  CYG_ADDRESS;
 typedef cyg_haladdrword CYG_ADDRWORD;
 
+// -------------------------------------------------------------------------
+// Number of elements in a (statically allocated) array.
+
+#define CYG_NELEM(a) (sizeof(a) / sizeof((a)[0]))
+
 // -------------------------------------------------------------------------
 // Constructor ordering macros.  These are added as annotations to all
 // static objects to order the constuctors appropriately.
@@ -313,7 +318,7 @@ typedef cyg_haladdrword CYG_ADDRWORD;
 // COMPILER-SPECIFIC STUFF
 
 #ifdef __GNUC__
-#if defined(__GNU_PATCHLEVEL__)
+#if defined(__GNUC_PATCHLEVEL__)
 # define __GNUC_VERSION__ (__GNUC__ * 10000 \
                             + __GNUC_MINOR__ * 100 \
                             + __GNUC_PATCHLEVEL__)
@@ -392,11 +397,11 @@ typedef cyg_haladdrword CYG_ADDRWORD;
 # define CYGBLD_ATTRIB_STRFTIME_FORMAT(__format__, __args__) \
         __attribute__((format (strftime, __format__, __args__)))
 
-// Tell the compiler not to throw away a variable or function. Only
-// available on 3.3.4 or above. Old version's didn't throw them away,
+// Tell the compiler not to throw away a variable or function. Only known
+// available on 3.3.2 or above. Old version's didn't throw them away,
 // but using the unused attribute should stop warnings.
 # if !defined(CYGBLD_ATTRIB_USED)
-#  if __GNUC_VERSION__ >= 30404
+#  if __GNUC_VERSION__ >= 30302
 #   define CYGBLD_ATTRIB_USED __attribute__((used))
 #  else
 #   define CYGBLD_ATTRIB_USED __attribute__((unused))