diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2010-04-24 15:22:17 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2010-04-24 15:22:17 +0000 |
commit | 03bb3e863663a034434b000fbfce2de7e908ba24 (patch) | |
tree | 0527de17bf999b709511880217423cea13a2ad51 | |
parent | fe151c135d3ffe3dff155d51f4f2680024ae8382 (diff) | |
download | netsurf-03bb3e863663a034434b000fbfce2de7e908ba24.tar.gz netsurf-03bb3e863663a034434b000fbfce2de7e908ba24.tar.bz2 |
remove _GNU_SOURCE define from everywhere.
strndup is not standard so provide an implementation.
svn path=/trunk/netsurf/; revision=10474
-rw-r--r-- | beos/beos_fetch_rsrc.cpp | 2 | ||||
-rw-r--r-- | beos/beos_gui.cpp | 1 | ||||
-rw-r--r-- | beos/beos_save_complete.cpp | 2 | ||||
-rw-r--r-- | content/fetchers/fetch_data.c | 2 | ||||
-rw-r--r-- | content/llcache.c | 1 | ||||
-rw-r--r-- | content/urldb.c | 1 | ||||
-rw-r--r-- | desktop/browser.c | 5 | ||||
-rw-r--r-- | desktop/save_complete.c | 3 | ||||
-rw-r--r-- | framebuffer/fbtk.h | 8 | ||||
-rw-r--r-- | gtk/gtk_gui.c | 1 | ||||
-rw-r--r-- | render/box_construct.c | 1 | ||||
-rw-r--r-- | render/form.c | 1 | ||||
-rw-r--r-- | render/html.c | 2 | ||||
-rw-r--r-- | render/hubbub_binding.c | 1 | ||||
-rw-r--r-- | render/layout.c | 1 | ||||
-rw-r--r-- | riscos/query.c | 1 | ||||
-rw-r--r-- | riscos/ucstables.c | 1 | ||||
-rw-r--r-- | riscos/url_protocol.c | 1 | ||||
-rw-r--r-- | utils/config.h | 13 | ||||
-rw-r--r-- | utils/url.c | 1 | ||||
-rw-r--r-- | utils/utf8.c | 1 | ||||
-rw-r--r-- | utils/utils.c | 2 |
22 files changed, 13 insertions, 39 deletions
diff --git a/beos/beos_fetch_rsrc.cpp b/beos/beos_fetch_rsrc.cpp index 8b2fa5e60..6d7ea4257 100644 --- a/beos/beos_fetch_rsrc.cpp +++ b/beos/beos_fetch_rsrc.cpp @@ -19,8 +19,6 @@ /* rsrc: URL handling. */ -#define _GNU_SOURCE - #define __STDBOOL_H__ 1 #include <assert.h> #include <errno.h> diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp index 21ff04b40..cb41dfa07 100644 --- a/beos/beos_gui.cpp +++ b/beos/beos_gui.cpp @@ -17,7 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE /* for strndup */ #define __STDBOOL_H__ 1 #include <assert.h> #include <ctype.h> diff --git a/beos/beos_save_complete.cpp b/beos/beos_save_complete.cpp index 12de212ac..c922cd72f 100644 --- a/beos/beos_save_complete.cpp +++ b/beos/beos_save_complete.cpp @@ -17,8 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE - #define __STDBOOL_H__ 1 #include <ctype.h> #include <stdio.h> diff --git a/content/fetchers/fetch_data.c b/content/fetchers/fetch_data.c index 51fade815..a58c971bf 100644 --- a/content/fetchers/fetch_data.c +++ b/content/fetchers/fetch_data.c @@ -18,8 +18,6 @@ /* data: URL handling. See http://tools.ietf.org/html/rfc2397 */ -#define _GNU_SOURCE - #include <assert.h> #include <errno.h> #include <stdbool.h> diff --git a/content/llcache.c b/content/llcache.c index 977c03804..d5b518403 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -20,7 +20,6 @@ * Low-level resource cache (implementation) */ -#define _GNU_SOURCE /* For strndup. Ugh. */ #include <stdlib.h> #include <string.h> #include <time.h> diff --git a/content/urldb.c b/content/urldb.c index ef2aa8c2f..dcd331946 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -86,7 +86,6 @@ * potential crashes. */ -#define _GNU_SOURCE /* For strndup */ #include <assert.h> #include <ctype.h> #include <stdbool.h> diff --git a/desktop/browser.c b/desktop/browser.c index 17490ebbe..04631a4df 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -157,11 +157,14 @@ struct browser_window *browser_window_create(const char *url, bw->no_resize = true; bw->last_action = wallclock(); + bw->window = gui_create_browser_window(bw, clone, new_tab); + /* gui window */ - if ((bw->window = gui_create_browser_window(bw, clone, new_tab)) == NULL) { + if (bw->window == NULL) { browser_window_destroy(bw); return NULL; } + if (url) browser_window_go(bw, url, referer, history_add); diff --git a/desktop/save_complete.c b/desktop/save_complete.c index d0a657bcd..2f698de8d 100644 --- a/desktop/save_complete.c +++ b/desktop/save_complete.c @@ -1,4 +1,4 @@ -/* +#/* * Copyright 2004 John M Bell <jmb202@ecs.soton.ac.uk> * Copyright 2004-2007 James Bursa <bursa@users.sourceforge.net> * @@ -23,7 +23,6 @@ #include "utils/config.h" -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <ctype.h> #include <errno.h> diff --git a/framebuffer/fbtk.h b/framebuffer/fbtk.h index b201a9d34..a3acc08b6 100644 --- a/framebuffer/fbtk.h +++ b/framebuffer/fbtk.h @@ -28,9 +28,13 @@ typedef struct fbtk_widget_s fbtk_widget_t; enum fbtk_callback_info_type { - FBTK_CBIT_NONE, - FBTK_CBIT_SCROLLX, + FBTK_CBIT_SCROLLX = 0, FBTK_CBIT_SCROLLY, + FBTK_CBIT_CLICK, + FBTK_CBIT_INPUT, + FBTK_CBIT_MOVE, + FBTK_CBIT_REDRAW, + FBTK_CBIT_END, }; typedef struct fbtk_callback_info { diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 8f5ccf3f9..3a749c67e 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -23,7 +23,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <stdbool.h> #include <stdio.h> diff --git a/render/box_construct.c b/render/box_construct.c index 71d30ddae..a5ceb2884 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -24,7 +24,6 @@ * Conversion of XML tree to box tree (implementation). */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <ctype.h> #include <stdio.h> diff --git a/render/form.c b/render/form.c index b81d2ca34..9584aa244 100644 --- a/render/form.c +++ b/render/form.c @@ -23,7 +23,6 @@ * Form handling functions (implementation). */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <ctype.h> #include <limits.h> diff --git a/render/html.c b/render/html.c index 0061ce925..51e466591 100644 --- a/render/html.c +++ b/render/html.c @@ -20,8 +20,6 @@ * Content for text/html (implementation). */ -#define _GNU_SOURCE /* for strndup() */ - #include <assert.h> #include <ctype.h> #include <stdint.h> diff --git a/render/hubbub_binding.c b/render/hubbub_binding.c index 1d8af25ca..fc0a31944 100644 --- a/render/hubbub_binding.c +++ b/render/hubbub_binding.c @@ -17,7 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <stdbool.h> #include <string.h> diff --git a/render/layout.c b/render/layout.c index 336be3e83..93818723f 100644 --- a/render/layout.c +++ b/render/layout.c @@ -31,7 +31,6 @@ * layout_minmax_X() and layout_X(). */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <limits.h> #include <stdbool.h> diff --git a/riscos/query.c b/riscos/query.c index 3cf18ac63..8a0087feb 100644 --- a/riscos/query.c +++ b/riscos/query.c @@ -16,7 +16,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE /* for strnlen */ #include <stdlib.h> #include <string.h> diff --git a/riscos/ucstables.c b/riscos/ucstables.c index 59ee8576a..9b259766c 100644 --- a/riscos/ucstables.c +++ b/riscos/ucstables.c @@ -20,7 +20,6 @@ * UCS conversion tables and RISC OS-specific UTF-8 text handling */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <limits.h> #include <string.h> diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c index 8b06d6f75..7629fd3d3 100644 --- a/riscos/url_protocol.c +++ b/riscos/url_protocol.c @@ -26,7 +26,6 @@ #include "utils/config.h" -#define _GNU_SOURCE /* for strndup */ #include <ctype.h> #include <stdio.h> #include <string.h> diff --git a/utils/config.h b/utils/config.h index ba8d8227b..ba6d9b464 100644 --- a/utils/config.h +++ b/utils/config.h @@ -23,19 +23,10 @@ /* 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); -#endif #define HAVE_STRCASESTR -#if (!(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \ +#if (!(defined(__NetBSD__) || defined(__OpenBSD__)) \ || defined(riscos) || defined(__APPLE__) || defined(_WIN32)) #undef HAVE_STRCASESTR char *strcasestr(const char *haystack, const char *needle); @@ -64,7 +55,7 @@ char *strcasestr(const char *haystack, const char *needle); #define HAVE_STRCHRNUL /* For some reason, UnixLib defines this unconditionally. * Assume we're using UnixLib if building for RISC OS. */ -#if !(defined(_GNU_SOURCE) || defined(riscos)) +#if !(defined(riscos)) #undef HAVE_STRCHRNUL char *strchrnul(const char *s, int c); #endif diff --git a/utils/url.c b/utils/url.c index b02d77756..5cb7305e8 100644 --- a/utils/url.c +++ b/utils/url.c @@ -22,7 +22,6 @@ * URL parsing and joining (implementation). */ -#define _GNU_SOURCE /* for strdup() */ #include <sys/types.h> #include <assert.h> #include <ctype.h> diff --git a/utils/utf8.c b/utils/utf8.c index f866562e1..d7fef5e7a 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -20,7 +20,6 @@ * UTF-8 manipulation functions (implementation). */ -#define _GNU_SOURCE /* for strndup */ #include <assert.h> #include <errno.h> #include <stdlib.h> diff --git a/utils/utils.c b/utils/utils.c index 175b33073..b0069365e 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -295,7 +295,6 @@ char *strcasestr(const char *haystack, const char *needle) #endif -#ifndef HAVE_STRNDUP /** * Duplicate up to n characters of a string. @@ -318,7 +317,6 @@ char *strndup(const char *s, size_t n) return s2; } -#endif #ifndef HAVE_STRCHRNUL |