Commit Graph

3264 Commits

Author SHA1 Message Date
Bastien Nocera
5e2a6047ea Bug 548612 – g_strstr_len() should use memmem when available
2008-08-28  Bastien Nocera  <hadess@hadess.net>

	Bug 548612 – g_strstr_len() should use memmem when available

	* configure.in: detect whether memmem is available in the C library
	* glib/gstrfuncs.c (g_strstr_len): use memmem for g_strstr_len() if
	available in it's available, as it could be optimised by the C library
	* tests/string-test.c (main): Add a few tests for g_strstr_len()


svn path=/trunk/; revision=7407
2008-08-27 23:23:23 +00:00
Tor Lillqvist
2c5de8ed26 Stylistic changes. Plug an unlikely memory leak that occurred in
2008-08-27  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c: Stylistic changes. Plug an unlikely memory leak
	that occurred in create_thread() if closing the thread handle
	failed. Add more error messages to g_io_win32_free() that are
	printed only when debugging. Plug handle leak, a socket channel's
	event was never closed.


svn path=/trunk/; revision=7405
2008-08-27 16:49:17 +00:00
Tor Lillqvist
194493f3f8 Should not define HAVE_DIRENT_H when compiling with MSVC, as the only file
2008-08-27  Tor Lillqvist  <tml@novell.com>

	* config.h.win32.in: Should not define HAVE_DIRENT_H when
	compiling with MSVC, as the only file which checks HAVE_DIRENT_H
	is gdir.c, and that includes the dirent.h and wdirent.c from
	build/win32/dirent explicitly anyway when being compiled with
	MSVC.


svn path=/trunk/; revision=7403
2008-08-27 12:48:57 +00:00
Björn Lindqvist
886c0e0d81 Bug 523939 – Example program for GValue
2008-08-22  Björn Lindqvist  <bjourne@gmail.com>

	Bug 523939 – Example program for GValue

	* gobject/gvalue.c: Add code example that demonstrates GValue's
	features.

svn path=/trunk/; revision=7387
2008-08-22 18:23:05 +00:00
Tor Lillqvist
54d62aa368 Don't bother compiling the binary compatibility
2008-08-21  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c: Don't bother compiling the binary
	compatibility g_io_channel_win32_new_stream_socket()
	function that has not been mentioned in any header since 2.0 on
	Win64.

	* glib/glib.symbols: Mark it, too, private, and don't export it on
	Win64.


svn path=/trunk/; revision=7384
2008-08-21 11:47:04 +00:00
Tor Lillqvist
5becc45bf4 Improve run-time warning messages. Drop some #if 0 code.
2008-08-21  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c: Improve run-time warning messages. Drop
	some #if 0 code.


svn path=/trunk/; revision=7383
2008-08-21 11:35:51 +00:00
Tor Lillqvist
2da8893a72 Minor comment improvements.
2008-08-21  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c: Minor comment improvements.


svn path=/trunk/; revision=7382
2008-08-21 11:24:00 +00:00
Tor Lillqvist
465d01a8c2 Improve last entry
svn path=/trunk/; revision=7380
2008-08-21 10:29:36 +00:00
Tor Lillqvist
605682521b Rework the g_poll() implementation on Windows to match poll() semantics
2008-08-21  Tor Lillqvist  <tml@novell.com>

	* glib/gmain.c: Rework the g_poll() implementation on Windows to
	match poll() semantics more closely. This makes the test program
	in bug #468910 behave better and doesn't seem to break anything
	else.

	If polling several GPollFDs, i.e. messages and/or waitable
	handles, first check if one or several of them are in the
	signalled state right away, and return indication for all that are
	in that case.

	If not, then poll with timeout and indicate only the single one
	that the Win32 wait function tells us as before.

	Remove unnecessary ifdefs, as we always have G_MAIN_POLL_DEBUG
	defined on Windows.

	Initialise g_main_poll_debug in g_main_context_new() so we have it
	before testing it in one case.

	Don't add several copies of a handle in the array of handles to
	wait for. The documentation says this is not allowed, although it
	did seem to work fine in practise. But do as the documentations
	says anyway.


svn path=/trunk/; revision=7375
2008-08-21 02:27:13 +00:00
Tor Lillqvist
971ab2b50f Bug 500246 - Bug fixes for giowin32
2008-08-20  Tor Lillqvist  <tml@novell.com>

	Bug 500246 - Bug fixes for giowin32

	* glib/giowin32.c (read_thread) (write_thread): Change the nbytes
	variables to signed.
	(g_io_channel_win32_make_pollfd): Fix an obvious error in the file
	descriptor case leftover after the patch from bug #333098 on
	2006-03-02. Thanks to Marcus Brinkmann.


svn path=/trunk/; revision=7373
2008-08-20 01:30:31 +00:00
Tor Lillqvist
f7f48d5c08 Bug 324234 - Using g_io_add_watch_full() to wait for connect() to return
2008-08-20  Tor Lillqvist  <tml@novell.com>

	Bug 324234 - Using g_io_add_watch_full() to wait for connect() to
	return on a non-blocking socket returns prematurely

	Bug 548278 - Async GETs connections are always terminated
	unexpectedly on Windows

	* glib/giowin32.c: Add one more state variable to the
	GIOWin32Channel struct, ever_writable. Initialise it to FALSE, set
	to TRUE when the WSAEventSelect() indicates FD_WRITE, and never
	reset to FALSE.

	Don't do the WSASetEvent() in g_io_win32_prepare() unless
	ever_writable is TRUE. Don't automatically indicate G_IO_OUT in
	g_io_win32_check() unless ever_writable is TRUE.

	This fixes the behaviour of the test case program in bug #548278,
	and the "Testcase for the spurious OUT event bug" in bug
	#324234. It also doesn't seem to break anything. Not that there is
	any exhaustive test suite...

	Add a comment with a list of bugs that are related to the code in
	this file.


svn path=/trunk/; revision=7372
2008-08-19 23:48:16 +00:00
Matthias Clasen
f1d6c42b3d Bump version
svn path=/trunk/; revision=7369
2008-08-18 13:21:56 +00:00
Matthias Clasen
e17c805ce4 2.17.7
svn path=/trunk/; revision=7367
2008-08-18 13:17:39 +00:00
Sven Neumann
4848eec5a6 mention GWinHttpVfs.
2008-08-17  Sven Neumann  <sven@gimp.org>

	* NEWS: mention GWinHttpVfs.


svn path=/trunk/; revision=7365
2008-08-17 10:39:59 +00:00
Matthias Clasen
372712df9b Updates
svn path=/trunk/; revision=7362
2008-08-16 04:01:57 +00:00
12:41:26 Tim Janik
6011a022d9 changed assertion messages, so older emacsen can also detect failing
2008-08-15 12:41:26  Tim Janik  <timj@imendio.com>

	* glib/gtestutils.c: changed assertion messages, so older emacsen
	can also detect failing source file and line, fixes:
	Bug 502498 – Test framework assertion failures should follow gcc error format


svn path=/trunk/; revision=7358
2008-08-15 10:44:57 +00:00
Matthias Clasen
d94f2b42be Accept lesser mmaps
svn path=/trunk/; revision=7356
2008-08-15 03:41:14 +00:00
Matthias Clasen
88c7129340 Bug 547337 – G_DISABLE_DEPRECATED breaks tests build
2008-08-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 547337 – G_DISABLE_DEPRECATED breaks tests build

        * tests/testglib.c: Protect deprecated API by ifdefs.
        Patch by Kalle Vahlman


svn path=/trunk/; revision=7353
2008-08-14 03:05:17 +00:00
Matthias Clasen
d62a4f6bf9 Bug 547637 – unconditional #include of sys/statfs.h in configure impedes
2008-08-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 547637 – unconditional #include of sys/statfs.h in configure
        impedes detection of statfs things if non-existant

        * configure.in: Protect the statfs.h include by guards.


svn path=/trunk/; revision=7352
2008-08-14 03:01:23 +00:00
Federico Mena Quintero
70323cf694 Hint about having to include config.h
2008-08-12  Federico Mena Quintero  <federico@novell.com>

	* glib/gi18n-lib.h: In the #error about having to define
	GETTEXT_PACKAGE, add a hint about a possibly-missing config.h.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=7343
2008-08-12 19:01:46 +00:00
Behdad Esfahbod
8b4e4a13d8 Bug 547200 – g_utf8_find_next_char() issues
2008-08-11  Behdad Esfahbod  <behdad@gnome.org>

        Bug 547200 – g_utf8_find_next_char() issues

        * glib/gutf8.c: Improve wording about @end arguments in str funcs.


svn path=/trunk/; revision=7337
2008-08-11 19:03:04 +00:00
Behdad Esfahbod
ae6300bd09 Fix docs to use "nul-terminated" consistently.
2008-08-10  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gutf8.c: Fix docs to use "nul-terminated" consistently.


svn path=/trunk/; revision=7334
2008-08-10 20:24:32 +00:00
Ryan Lortie
ce42e7ad4a Fix 'fail' markup test cases to -not- be valid XML 1.1.
2008-08-08  Ryan Lortie  <desrt@desrt.ca>

        * tests/markups/fail-32.gmarkup: change &#x10; to &#x0; since the
        former is no longer a failure.


svn path=/trunk/; revision=7328
2008-08-08 18:35:19 +00:00
Ryan Lortie
4958c5cd4e Bug 546876 - Modify GMarkup parser to accept &#x1; .. &#x1f;
2008-08-08  Ryan Lortie  <desrt@desrt.ca>

        * glib/gmarkup.c: previously the parser only accepted character
        references for \t \n and \r (as per XML 1.0); now it accepts all
        of &#x1; .. &#x1f;.


svn path=/trunk/; revision=7326
2008-08-08 16:41:30 +00:00
Tor Lillqvist
c13b9d5d63 Output comment clarifying GPid semantics to glibconfig.h.
2008-08-07  Tor Lillqvist  <tml@novell.com>

	* configure.in: Output comment clarifying GPid semantics to
	glibconfig.h.

	* glibconfig.h.win32.in: Ditto here.


svn path=/trunk/; revision=7317
2008-08-07 15:40:03 +00:00
Matthias Clasen
065928c778 Fix a doc issue
svn path=/trunk/; revision=7310
2008-08-05 01:23:16 +00:00
Tor Lillqvist
fb17a5de30 Make the union _GSystemThread::data array 8 bytes on Win64. Not that it
2008-08-04  Tor Lillqvist  <tml@novell.com>

	* glibconfig.h.win32.in: Make the union _GSystemThread::data array
	8 bytes on Win64. Not that it matters as the union contains a
	pointer also anyway, but for equivalence with the configure-
	generated glibconfig.h


svn path=/trunk/; revision=7309
2008-08-04 19:32:26 +00:00
Tor Lillqvist
c9211d68fc MSDN says: "Do not cast a pointer to a FILETIME structure to either a
2008-08-04  Tor Lillqvist  <tml@novell.com>

	* glib/gmain.c (g_get_current_time): MSDN says: "Do not cast a
	pointer to a FILETIME structure to either a LARGE_INTEGER* or
	__int64* value because it can cause alignment faults on 64-bit
	Windows." So don't do that then. Indeed the code did work randomly
	on Win64 when compiled with optimisation.


svn path=/trunk/; revision=7308
2008-08-04 19:22:05 +00:00
Tor Lillqvist
0e2384faa8 glib/giowin32.c glib/gmain.c glib/gspawn-win32.c Change gssize casts
2008-08-04  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c
	* glib/gmain.c
	* glib/gspawn-win32.c
	* glib/gspawn-win32-helper.c: Change gssize casts introduced on
	2008-07-28 to gintptr casts now that we have that. gssize is as
	such the same as gintptr on both 32- and 64-bit Windows, but the
	gintptr name indicates that it is used to hold pointers, i.e. also
	HANDLEs.


svn path=/trunk/; revision=7306
2008-08-04 18:46:59 +00:00
Tor Lillqvist
b5b363019a Avoid warning on Win64 by using gintptr cast instead if long cast.
2008-08-04  Tor Lillqvist  <tml@novell.com>

	* tests/testglib.c: Avoid warning on Win64 by using gintptr cast
	instead if long cast.


svn path=/trunk/; revision=7304
2008-08-04 18:12:11 +00:00
Matthias Clasen
b71a3a0f6b Bump version
svn path=/trunk/; revision=7303
2008-08-04 18:00:48 +00:00
Matthias Clasen
26c1be0d51 2.13.6
svn path=/trunk/; revision=7301
2008-08-04 17:58:13 +00:00
Matthias Clasen
1a9db68e53 Bump version
svn path=/trunk/; revision=7299
2008-08-04 17:02:59 +00:00
Matthias Clasen
ab0f863606 2.17.5
svn path=/trunk/; revision=7297
2008-08-04 17:01:23 +00:00
Matthias Clasen
5d4b0f7c23 Updates
svn path=/trunk/; revision=7295
2008-08-04 16:03:41 +00:00
Tor Lillqvist
e4194cb055 Add 64-bit versions of GPOINTER_TO_INT(), GPOINTER_TO_UINT() and vice
2008-08-02  Tor Lillqvist  <tml@novell.com>

	* glibconfig.h.win32.in: Add 64-bit versions of
	GPOINTER_TO_INT(), GPOINTER_TO_UINT() and vice versa, too.


svn path=/trunk/; revision=7288
2008-08-02 11:21:14 +00:00
Tor Lillqvist
59137b9923 Add gintptr and guintptr typedefs here, too, appropriately ifdeffed for
2008-08-02  Tor Lillqvist  <tml@novell.com>

	* glibconfig.h.win32.in: Add gintptr and guintptr typedefs here,
	too, appropriately ifdeffed for 32/64 bit, gcc/MSVC.


svn path=/trunk/; revision=7287
2008-08-02 08:51:27 +00:00
Matthias Clasen
3fceef00aa Updates
svn path=/trunk/; revision=7285
2008-08-01 22:16:03 +00:00
Matthias Clasen
a1c45bd9ae Add a since
svn path=/trunk/; revision=7279
2008-08-01 18:30:37 +00:00
Tor Lillqvist
274c2dc8c5 Bug 545485 - Implicit declaration of utime()
2008-07-30  Tor Lillqvist  <tml@novell.com>

	Bug 545485 - Implicit declaration of utime()

	* glib/gstdio.c: Include <utime.h> on POSIX.


svn path=/trunk/; revision=7273
2008-07-30 15:35:01 +00:00
Tor Lillqvist
6eb6ee655e Output to glibconfig.h typedefs for gintptr as the signed integer type
2008-07-28  Tor Lillqvist  <tml@novell.com>

	* configure.in: Output to glibconfig.h typedefs for gintptr as the
	signed integer type that can hold a pointer, and guintptr as the
	corresponding unsigned type. These types are portable equivalents
	to intptr_t and uintptr_t which are not available in all
	compilers.

	For all current platforms, they will presumably end up as the same
	types as gssize and gsize, but in theory size_t can be smaller
	than intptr_t. Also, the intended use case for gintptr and
	guintptr is different from that of gssize and gsize. As the name
	indicates, gintptr is for when one wants an integer type that can
	hold a pointer, and gsize is for when one wants an integer type
	that can hold the value of the sizeof operator.


svn path=/trunk/; revision=7272
2008-07-30 15:30:26 +00:00
Matthias Clasen
99a6b0d4e4 Add g_markup_context_get_user_data
svn path=/trunk/; revision=7265
2008-07-28 16:52:15 +00:00
Tor Lillqvist
6f84cab2a8 Message catalogs should always get installed into share/locale nowadays,
2008-07-28  Tor Lillqvist  <tml@novell.com>

	* glib-zip.in: Message catalogs should always get installed into
	share/locale nowadays, don't bother with the convoluted logic
	checking if they are in lib/locale instead. Put the correct helper
	programs in the zipfile.


svn path=/trunk/; revision=7262
2008-07-28 00:36:49 +00:00
Tor Lillqvist
a3fa74853a Fix problems on 64-bit Windows. Avoid warnings, some of which indicated
2008-07-28  Tor Lillqvist  <tml@novell.com>

	Fix problems on 64-bit Windows. Avoid warnings, some of which
	indicated actual problems, some which were just annoyances. 

	Where casts to an integer type are needed for pointers, use
	gssize. Technically intptr_t would be the more proper type, but we
	still want to be compilable with MSVS6 and 7 which don't have
	intptr_t. MSVS8 and 9 do have intptr_t, but in <crtdefs.h>, not
	<stdint.h>.

	Use %p to print out handles. Use gssize casts when assigning
	GPollFD::fd fields.

	Use G_GSIZE_FORMAT when printing size_t values.
	
	* configure.in: Define automake conditional G_OS_WIN32_X64 which
	is true on Win64.

	* glib/giochannel.h: Use slightly different prototype for
	g_io_channel_win32_new_messages() on Win64 with gsize instead of
	guint.

	* glib/giowin32.c
	* glib/gmain.c
	* glib/gspawn-win32.c
	* tests/testglib.c: Generic changes as described above.

	* glib/gmain.h: Don't bother mentioning GIMP in comment.

	* glib/grel.c (tuple_hash_2): Use all bits of pointer.

	* glib/gspawn-win32.c
	* glib/gspawn-win32-helper.c: Use gssize types in the
	communication between parent and helper process, so that we can
	pass process handles, which are pointers, also on Win64.

	* glib/gtimer.c (g_time_val_to_iso8601): time_t is 64 bits on
	Win64 so we can't pass the address of a GTimeVal::tv_sec which is
	a long directly to gmtime(). On the other hand, changing
	GTimeVal::tv_sec to be a gint64 on Win64 is not really feasible
	either, as that would then require changes in much code that uses
	GTimeVals.

	* glib/gspawn-win32.c
	* glib/Makefile.am: Call the helper programs
	gspawn-win64-helper.exe and gspawn-win64-helper-console.exe on
	Win64, to avoid potential risk of running a 32-bit version of the
	helper.


svn path=/trunk/; revision=7260
2008-07-28 00:24:14 +00:00
Tor Lillqvist
80ecc30841 glib/glib.symbols glib/gconvert.c glib/gdir.c glib/gfileutils.c
2008-07-27  Tor Lillqvist  <tml@novell.com>

	* glib/glib.symbols
	* glib/gconvert.c
	* glib/gdir.c
	* glib/gfileutils.c
	* glib/giowin32.c
	* glib/gspawn-win32.c
	* glib/gutils.c
	* glib/gwin32.c: Bypass the Windows "ABI compatibility" symbols on
	_WIN64. As there hasn't been any widely deployed 64-bit Windows
	builds of the really old GLib (pre-2.8.1) versions those refer to,
	there is no need to have the "ABI compatibility" versions in the
	DLL.

	* glib/makegalias.pl: Handle #ifndef _WIN64: Just output it, too.


svn path=/trunk/; revision=7257
2008-07-27 17:15:16 +00:00
Tor Lillqvist
a076a30457 Set LIB_EXE_MACHINE_FLAG to either X86 or X64 on Windows. AC_SUBST it.
2008-07-27  Tor Lillqvist  <tml@novell.com>

	* configure.in: Set LIB_EXE_MACHINE_FLAG to either X86 or X64 on
	Windows. AC_SUBST it.

	* */Makefile.am: Correspondingly, pass appropriate -machine
	flag to lib.exe when producing the import library for the MS
	toolchain.


svn path=/trunk/; revision=7255
2008-07-27 15:54:15 +00:00
15:47:08 Tim Janik
8017661f6d added new sample test to prepare for extended range random tests.
2008-07-25 15:47:08  Tim Janik  <timj@imendio.com>

        * glib/tests/testing.c (test_random_conversions): added new sample
        test to prepare for extended range random tests.


svn path=/trunk/; revision=7253
2008-07-25 13:49:00 +00:00
Tor Lillqvist
1fdca0ad31 Include <stdio.h> for FILENAME_MAX on newer mingw installations.
2008-07-24  Tor Lillqvist  <tml@novell.com>

	* glib/gdir.c: Include <stdio.h> for FILENAME_MAX on newer mingw
	installations.


svn path=/trunk/; revision=7251
2008-07-24 01:13:33 +00:00
Tor Lillqvist
440ebdec6f Use G_GSIZE_FORMAT instead of the C99 "zu".
2008-07-24  Tor Lillqvist  <tml@novell.com>

	* glib/gslice.c (smc_notify_free): Use G_GSIZE_FORMAT instead of
	the C99 "zu".


svn path=/trunk/; revision=7249
2008-07-24 00:50:08 +00:00
Tor Lillqvist
c023cc94f8 Must output the GLIB_USING_SYSTEM_PRINTF to glibconfig.h using the same
2008-07-24  Tor Lillqvist  <tml@novell.com>

	* configure.in: Must output the GLIB_USING_SYSTEM_PRINTF to
	glibconfig.h using the same two phase code as for the other
	defines in it. Can't check enable_included_printf directly in the
	shell code that is the first argument to AC_CONFIG_COMMANDS().

	Preset glib_cv_stack_grows=no on Windows to help
	cross-compilation.

	* configure.in: Enhancements for 64-bit Windows: 

	Handle also size_t being larger than long. It is long long
	a.k.a. __int64 on the LLP64 Win64.

	Set glib_void_p and glib_long correctly. Their assignments were
	crossed. It hasn't mattered on LP64 platforms like all (?) 64-bit
	UNIXes, but on the LLP Win64 it was wrong.


svn path=/trunk/; revision=7248
2008-07-24 00:29:56 +00:00