Skip to content

Commit

Permalink
project: Rename gnulib functions to prevent conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Oct 26, 2024
1 parent 236c314 commit 86c8604
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 8 additions & 4 deletions SMP/gnulib/lib/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ extern int rpl_snprintf(char *str, size_t size, const char *format, ...);
extern int rpl_sprintf(char *str, const char *format, ...);
#define sprintf rpl_sprintf
#endif
extern ssize_t getdelim(char **lineptr, size_t *n, int delimiter, FILE *fp);
extern ssize_t getline(char **lineptr, size_t *n, FILE *stream);
extern int vasprintf(char **resultp, const char *format, va_list args);
extern char *vasnprintf(char *resultbuf, size_t *lengthp, const char *format, va_list args);
extern ssize_t rpl_getdelim(char **lineptr, size_t *n, int delimiter, FILE *fp);
#define getdelim rpl_getdelim
extern ssize_t rpl_getline(char **lineptr, size_t *n, FILE *stream);
#define getline rpl_getline
extern int rpl_vasprintf(char **resultp, const char *format, va_list args);
#define vasprintf rpl_vasprintf
extern char *rpl_vasnprintf(char *resultbuf, size_t *lengthp, const char *format, va_list args);
#define vasnprintf rpl_vasnprintf

// Prevent undefined functions from being used
#define dprintf(...) error
Expand Down
9 changes: 6 additions & 3 deletions SMP/gnulib/lib/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@
#define strcasecmp _stricmp
#define strncasecmp _strnicmp

extern void *memmem(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len);
extern int strverscmp(const char *s1, const char *s2);
extern void explicit_bzero(void *s, size_t len);
extern void *rpl_memmem(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len);
#define memmem rpl_memmem
extern int rpl_strverscmp(const char *s1, const char *s2);
#define strverscmp rpl_strverscmp
extern void rpl_explicit_bzero(void *s, size_t len);
#define explicit_bzero rpl_explicit_bzero

#endif /* _MSC_VER */

Expand Down

0 comments on commit 86c8604

Please sign in to comment.