-extern void * tfind (const void *key, void *const *vrootp,
- int (*compar) (const void *, const void *))
- _GL_ARG_NONNULL ((1, 2, 3));
+# if @REPLACE_TSEARCH@
+_GL_FUNCDECL_RPL (tfind, void *,
+ (const void *key, void *const *vrootp,
+ _gl_search_compar_fn compar)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (tfind, void *,
+ (const void *key, void *const *vrootp,
+ _gl_search_compar_fn compar));
+# else
+# if !@HAVE_TSEARCH@
+_GL_FUNCDECL_SYS (tfind, void *,
+ (const void *key, void *const *vrootp,
+ _gl_search_compar_fn compar)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the second parameter is
+ void **vrootp. */
+_GL_CXXALIAS_SYS_CAST (tfind, void *,
+ (const void *key, void *const *vrootp,
+ _gl_search_compar_fn compar));
+# endif
+_GL_CXXALIASWARN (tfind);