mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
Add HAVE_STRNDUP and supporting structure to config.h and make utils.[ch] reflect it.
svn path=/trunk/netsurf/; revision=3351
This commit is contained in:
parent
43257a160b
commit
36ecbc6be2
@ -9,7 +9,18 @@
|
|||||||
#ifndef _NETSURF_UTILS_CONFIG_H_
|
#ifndef _NETSURF_UTILS_CONFIG_H_
|
||||||
#define _NETSURF_UTILS_CONFIG_H_
|
#define _NETSURF_UTILS_CONFIG_H_
|
||||||
|
|
||||||
/* This file toggles build options on and off.
|
/* Try to detect which features the target OS supports */
|
||||||
|
|
||||||
|
#define HAVE_STRNDUP
|
||||||
|
#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun))
|
||||||
|
/* FreeBSD and Solaris do not have this function, so
|
||||||
|
* we implement it ourselves in util.c
|
||||||
|
*/
|
||||||
|
#undef HAVE_STRNDUP
|
||||||
|
char *strndup(const char *s, size_t n);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This section toggles build options on and off.
|
||||||
* Simply undefine a symbol to turn the relevant feature off.
|
* Simply undefine a symbol to turn the relevant feature off.
|
||||||
*
|
*
|
||||||
* IF ADDING A FEATURE HERE, ADD IT TO Docs/Doxyfile LINE 892 AS WELL.
|
* IF ADDING A FEATURE HERE, ADD IT TO Docs/Doxyfile LINE 892 AS WELL.
|
||||||
|
@ -257,7 +257,7 @@ unsigned int wallclock(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || (defined(__SVR4) && defined(__sun))
|
#ifndef HAVE_STRNDUP
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate up to n characters of a string.
|
* Duplicate up to n characters of a string.
|
||||||
|
@ -59,10 +59,6 @@ const char *rfc1123_date(time_t t);
|
|||||||
char *strcasestr(const char *haystack, const char *needle);
|
char *strcasestr(const char *haystack, const char *needle);
|
||||||
#endif
|
#endif
|
||||||
unsigned int wallclock(void);
|
unsigned int wallclock(void);
|
||||||
#ifdef __FreeBSD__
|
|
||||||
/* FreeBSD lacks strndup */
|
|
||||||
char *strndup(const char *s, size_t n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Platform specific functions */
|
/* Platform specific functions */
|
||||||
void die(const char * const error);
|
void die(const char * const error);
|
||||||
|
Loading…
Reference in New Issue
Block a user