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 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 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-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-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 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-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 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-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-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-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-08 Ryan Lortie <desrt@desrt.ca>
* tests/markups/fail-32.gmarkup: change  to � since the
former is no longer a failure.
svn path=/trunk/; revision=7328
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  .. .
svn path=/trunk/; revision=7326
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 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 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 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-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-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-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 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-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 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-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-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 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 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