about summary refs log tree commit diff
path: root/include/ifunc-impl-list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ifunc-impl-list.h')
-rw-r--r--include/ifunc-impl-list.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/ifunc-impl-list.h b/include/ifunc-impl-list.h
index 78087f015c..00bf48f3f1 100644
--- a/include/ifunc-impl-list.h
+++ b/include/ifunc-impl-list.h
@@ -34,15 +34,15 @@ struct libc_ifunc_impl
 
 /* Add an IFUNC implementation, IMPL, for function FUNC, to ARRAY with
    USABLE at index I and advance I by one.  */
-#define IFUNC_IMPL_ADD(array, i, func, usable, impl) \
+#define IFUNC_IMPL_ADD(array, max, func, usable, impl) \
   extern __typeof (func) impl attribute_hidden; \
-  (array)[i++] = (struct libc_ifunc_impl) { #impl, (void (*) (void)) impl, (usable) };
+  if (n < max) (array)[n++] = (struct libc_ifunc_impl) { #impl, (void (*) (void)) impl, (usable) };
 
 /* Return the number of IFUNC implementations, N, for function FUNC if
    string NAME matches FUNC.  */
-#define IFUNC_IMPL(n, name, func, ...) \
+#define IFUNC_IMPL(max, name, func, ...) \
   if (strcmp (name, #func) == 0) \
-    { \
+    { size_t n = 0;\
       __VA_ARGS__; \
       return n; \
     }