mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
remove _GNU_SOURCE define from everywhere.
strndup is not standard so provide an implementation. svn path=/trunk/netsurf/; revision=10474
This commit is contained in:
parent
fe151c135d
commit
03bb3e8636
@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
/* rsrc: URL handling. */
|
/* rsrc: URL handling. */
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#define __STDBOOL_H__ 1
|
#define __STDBOOL_H__ 1
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#define __STDBOOL_H__ 1
|
#define __STDBOOL_H__ 1
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#define __STDBOOL_H__ 1
|
#define __STDBOOL_H__ 1
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
/* data: URL handling. See http://tools.ietf.org/html/rfc2397 */
|
/* data: URL handling. See http://tools.ietf.org/html/rfc2397 */
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* Low-level resource cache (implementation)
|
* Low-level resource cache (implementation)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* For strndup. Ugh. */
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -86,7 +86,6 @@
|
|||||||
* potential crashes.
|
* potential crashes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* For strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -157,11 +157,14 @@ struct browser_window *browser_window_create(const char *url,
|
|||||||
bw->no_resize = true;
|
bw->no_resize = true;
|
||||||
bw->last_action = wallclock();
|
bw->last_action = wallclock();
|
||||||
|
|
||||||
|
bw->window = gui_create_browser_window(bw, clone, new_tab);
|
||||||
|
|
||||||
/* gui window */
|
/* gui window */
|
||||||
if ((bw->window = gui_create_browser_window(bw, clone, new_tab)) == NULL) {
|
if (bw->window == NULL) {
|
||||||
browser_window_destroy(bw);
|
browser_window_destroy(bw);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url)
|
if (url)
|
||||||
browser_window_go(bw, url, referer, history_add);
|
browser_window_go(bw, url, referer, history_add);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
#/*
|
||||||
* Copyright 2004 John M Bell <jmb202@ecs.soton.ac.uk>
|
* Copyright 2004 John M Bell <jmb202@ecs.soton.ac.uk>
|
||||||
* Copyright 2004-2007 James Bursa <bursa@users.sourceforge.net>
|
* Copyright 2004-2007 James Bursa <bursa@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "utils/config.h"
|
#include "utils/config.h"
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -28,9 +28,13 @@
|
|||||||
typedef struct fbtk_widget_s fbtk_widget_t;
|
typedef struct fbtk_widget_s fbtk_widget_t;
|
||||||
|
|
||||||
enum fbtk_callback_info_type {
|
enum fbtk_callback_info_type {
|
||||||
FBTK_CBIT_NONE,
|
FBTK_CBIT_SCROLLX = 0,
|
||||||
FBTK_CBIT_SCROLLX,
|
|
||||||
FBTK_CBIT_SCROLLY,
|
FBTK_CBIT_SCROLLY,
|
||||||
|
FBTK_CBIT_CLICK,
|
||||||
|
FBTK_CBIT_INPUT,
|
||||||
|
FBTK_CBIT_MOVE,
|
||||||
|
FBTK_CBIT_REDRAW,
|
||||||
|
FBTK_CBIT_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct fbtk_callback_info {
|
typedef struct fbtk_callback_info {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
* Conversion of XML tree to box tree (implementation).
|
* Conversion of XML tree to box tree (implementation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
* Form handling functions (implementation).
|
* Form handling functions (implementation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
* Content for text/html (implementation).
|
* Content for text/html (implementation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup() */
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
* layout_minmax_X() and layout_X().
|
* layout_minmax_X() and layout_X().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strnlen */
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* UCS conversion tables and RISC OS-specific UTF-8 text handling
|
* UCS conversion tables and RISC OS-specific UTF-8 text handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "utils/config.h"
|
#include "utils/config.h"
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -23,19 +23,10 @@
|
|||||||
|
|
||||||
/* Try to detect which features the target OS supports */
|
/* Try to detect which features the target OS supports */
|
||||||
|
|
||||||
#define HAVE_STRNDUP
|
|
||||||
#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun)) || \
|
|
||||||
defined(__APPLE__) || defined(__HAIKU__) || defined(__BEOS__) \
|
|
||||||
|| defined(__OpenBSD__) || defined(_WIN32)
|
|
||||||
/* 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);
|
char *strndup(const char *s, size_t n);
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_STRCASESTR
|
#define HAVE_STRCASESTR
|
||||||
#if (!(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \
|
#if (!(defined(__NetBSD__) || defined(__OpenBSD__)) \
|
||||||
|| defined(riscos) || defined(__APPLE__) || defined(_WIN32))
|
|| defined(riscos) || defined(__APPLE__) || defined(_WIN32))
|
||||||
#undef HAVE_STRCASESTR
|
#undef HAVE_STRCASESTR
|
||||||
char *strcasestr(const char *haystack, const char *needle);
|
char *strcasestr(const char *haystack, const char *needle);
|
||||||
@ -64,7 +55,7 @@ char *strcasestr(const char *haystack, const char *needle);
|
|||||||
#define HAVE_STRCHRNUL
|
#define HAVE_STRCHRNUL
|
||||||
/* For some reason, UnixLib defines this unconditionally.
|
/* For some reason, UnixLib defines this unconditionally.
|
||||||
* Assume we're using UnixLib if building for RISC OS. */
|
* Assume we're using UnixLib if building for RISC OS. */
|
||||||
#if !(defined(_GNU_SOURCE) || defined(riscos))
|
#if !(defined(riscos))
|
||||||
#undef HAVE_STRCHRNUL
|
#undef HAVE_STRCHRNUL
|
||||||
char *strchrnul(const char *s, int c);
|
char *strchrnul(const char *s, int c);
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
* URL parsing and joining (implementation).
|
* URL parsing and joining (implementation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strdup() */
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* UTF-8 manipulation functions (implementation).
|
* UTF-8 manipulation functions (implementation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE /* for strndup */
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -295,7 +295,6 @@ char *strcasestr(const char *haystack, const char *needle)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRNDUP
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate up to n characters of a string.
|
* Duplicate up to n characters of a string.
|
||||||
@ -318,7 +317,6 @@ char *strndup(const char *s, size_t n)
|
|||||||
return s2;
|
return s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_STRCHRNUL
|
#ifndef HAVE_STRCHRNUL
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user