Skip to content
Snippets Groups Projects
Commit 84bafea6 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

#undef symbols before #defining them. This provides a little protection

when symbol being replaced was defined as a macro.
parent 19c2a483
No related branches found
No related tags found
No related merge requests found
......@@ -32,24 +32,30 @@
# endif
# ifndef HAVE_STRRCHR
# undef strchr
# define strchr index
# undef strrchr
# define strrchr rindex
# endif
# ifndef HAVE_MEMCPY
# undef memcpy
# define memcpy(d, s, n) ((void) bcopy ((s), (d), (n)))
# undef memmove
# define memmove(d, s, n) ((void) bcopy ((s), (d), (n)))
# endif
#endif
extern char *ldap_pvt_strtok( char *str, const char *delim, char **pos );
#ifndef HAVE_STRTOK_R
# undef strtok_r
# define strtok_r(s, d, p) ldap_pvt_strtok((s),(d),(p))
#endif
extern char *ldap_pvt_strdup( const char * s );
#ifndef HAVE_STRDUP
/* strdup() is missing, declare our own version */
# undef strdup
# define strdup(s) ldap_pvt_strdup(s)
#else
/* some systems fail to declare strdup */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment