define PCRE_STATIC to reflect the inclusion of pcre as LIB, not

2007-03-17  Hans Breuer  <hans@breuer.org>

	* glib/makefile.msc.in glib/pcre/makefile.msc 
	  glib/update-pcre/update.sh : define PCRE_STATIC to reflect the 
	inclusion of pcre as LIB, not stand-alone DLL. Also set NEWLINE=-1
	to match any newline by default, use of ../../build/win32/make.msc

	* glib/gregex.h : minimal includes of <glib/*.H> instead of <glib.h>

	* glib/gnulib/makefile.msc : make use of ../../build/win32/make.msc

	* tests/regex-test.c(verbose): don't pass a string containing '%' 
	as first parameter to g_print ()
	(test_match) : for the unexpected case output pattern and string
	escaped

	* tests/child-test.c tests/slice-color.c : fix c99ism
	* tests/slice-test.c : fix c99ism and gccism
	* tests/mapping-test.c tests/base-64-tests.c : don't 
	#include <unistd.h> unconditionally
	* tests/option-test.c : use G_GINT64_CONSTANT() instead of direct LL

	* tests/makefile.msc.in : more tests build


svn path=/trunk/; revision=5423
This commit is contained in:
Hans Breuer 2007-03-17 09:49:09 +00:00 committed by Hans Breuer
parent 45b2988d05
commit 770b29bad2
14 changed files with 157 additions and 80 deletions

View File

@ -1,3 +1,27 @@
2007-03-17 Hans Breuer <hans@breuer.org>
* glib/makefile.msc.in glib/pcre/makefile.msc
glib/update-pcre/update.sh : define PCRE_STATIC to reflect the
inclusion of pcre as LIB, not stand-alone DLL. Also set NEWLINE=-1
to match any newline by default, use of ../../build/win32/make.msc
* glib/gregex.h : minimal includes of <glib/*.H> instead of <glib.h>
* glib/gnulib/makefile.msc : make use of ../../build/win32/make.msc
* tests/regex-test.c(verbose): don't pass a string containing '%'
as first parameter to g_print ()
(test_match) : for the unexpected case output pattern and string
escaped
* tests/child-test.c tests/slice-color.c : fix c99ism
* tests/slice-test.c : fix c99ism and gccism
* tests/mapping-test.c tests/base-64-tests.c : don't
#include <unistd.h> unconditionally
* tests/option-test.c : use G_GINT64_CONSTANT() instead of direct LL
* tests/makefile.msc.in : more tests build
2007-03-17 Matthias Clasen <mclasen@redhat.com>
* glib/gsequence.[hc]:
@ -42,6 +66,7 @@ Fri Mar 16 11:24:51 2007 Tim Janik <timj@imendio.com>
* glib/gscanner.c (g_scanner_get_token_ll): Fix a typo
in the last commit. (#415323, Richard Hult)
>>>>>>> .r5422
2007-03-15 Tor Lillqvist <tml@novell.com>
* glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so

View File

@ -1,10 +1,8 @@
!IFDEF DEBUG
CRT=-MDd
!ELSE
CRT=-MD
!ENDIF
TOP = ..\..\..
!INCLUDE ..\..\build\win32\make.msc
CFLAGS = -I ..\.. -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
INCLUDES = -I ..\..
DEFINES = -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
OBJECTS = \
asnprintf.obj \
@ -13,8 +11,8 @@ OBJECTS = \
printf-parse.obj \
vasnprintf.obj
all : gnulib.lib
gnulib.lib : $(OBJECTS)
lib -out:gnulib.lib $(OBJECTS)
.c.obj:
$(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<

View File

@ -22,7 +22,8 @@
#ifndef __G_REGEX_H__
#define __G_REGEX_H__
#include <glib.h>
#include <glib/gerror.h>
#include <glib/gstring.h>
G_BEGIN_DECLS

View File

@ -8,7 +8,7 @@ TOP = ..\..
################################################################
INCLUDES = -FImsvc_recommended_pragmas.h -I . -I ..
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DPCRE_STATIC
DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS)
all : \

View File

@ -1,16 +1,17 @@
!IFDEF DEBUG
CRT=-MDd
!ELSE
CRT=-MD
!ENDIF
TOP = ..\..\..
!INCLUDE ..\..\build\win32\make.msc
CFLAGS = \
INCLUDES = \
-I ..\.. \
-I ..
DEFINES = \
-DPCRE_STATIC \
-DHAVE_CONFIG_H \
-DHAVE_LONG_LONG_FORMAT \
-DSUPPORT_UCP \
-DSUPPORT_UTF8 \
-DNEWLINE=10 \
-DNEWLINE=-1 \
-DMATCH_LIMIT=10000000 \
-DMATCH_LIMIT_RECURSION=10000000 \
-DMAX_NAME_SIZE=32 \
@ -42,8 +43,7 @@ OBJECTS = \
pcre_version.obj \
pcre_xclass.obj \
all : pcre.lib
pcre.lib : $(OBJECTS)
lib -out:pcre.lib $(OBJECTS)
.c.obj:
$(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<

View File

@ -84,19 +84,20 @@ cat $IN/Makefile.am-2 >> Makefile.am
# Generate makefile.msc
cat > makefile.msc << EOF
!IFDEF DEBUG
CRT=-MDd
!ELSE
CRT=-MD
!ENDIF
TOP = ..\..\..
!INCLUDE ..\..\build\win32\make.msc
CFLAGS = \\
-I ..\\.. \\
INCLUDES = \\
-I ..\.. \\
-I ..
DEFINES = \\
-DPCRE_STATIC \\
-DHAVE_CONFIG_H \\
-DHAVE_LONG_LONG_FORMAT \\
-DSUPPORT_UCP \\
-DSUPPORT_UTF8 \\
-DNEWLINE=10 \\
-DNEWLINE=-1 \\
-DMATCH_LIMIT=10000000 \\
-DMATCH_LIMIT_RECURSION=10000000 \\
-DMAX_NAME_SIZE=32 \\

View File

@ -1,6 +1,10 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#define DATA_SIZE 1024

View File

@ -146,6 +146,9 @@ test_thread (gpointer data)
int
main (int argc, char *argv[])
{
#ifndef TEST_THREAD
GPid pid;
#endif
#ifdef G_OS_WIN32
argv0 = argv[0];
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'c')
@ -166,8 +169,6 @@ main (int argc, char *argv[])
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
#ifdef TEST_THREAD
g_thread_init (NULL);
#else
GPid pid;
#endif
main_loop = g_main_loop_new (NULL, FALSE);

View File

@ -8,32 +8,54 @@ TOP = ..\..
################################################################
INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I ..\glib -I ..\gmodule
DEFINES = -DHAVE_CONFIG_H
DEFINES = -DHAVE_CONFIG_H -DENABLE_REGEX
NONAUTOMATIC_TESTS = \
testglib.exe \
testgdate.exe \
testgdateparser.exe \
patterntest.exe \
unicode-normalize.exe \
unicode-collate.exe
TESTS = \
atomic-test.exe \
array-test.exe \
asyncqueue-test.exe \
base64-test.exe \
bit-test.exe \
bookmarkfile-test.exe \
child-test.exe \
completion-test.exe \
convert-test.exe \
date-test.exe \
dirname-test.exe\
dirname-test.exe \
env-test.exe \
errorcheck-mutex-test.exe \
file-test.exe \
gio-test.exe \
iochannel-test.exe \
hash-test.exe \
keyfile-test.exe \
list-test.exe \
mainloop-test.exe \
mapping-test.exe \
markup-escape-test.exe \
markup-test.exe \
#main? memchunks.exe \
module-test.exe \
node-test.exe \
option-test.exe \
patterntest.exe \
printf-test.exe \
queue-test.exe \
qsort-test.exe \
rand-test.exe \
relation-test.exe\
regex-test.exe \
relation-test.exe \
#_? sequence-test.exe \
shell-test.exe \
slice-color.exe \
slice-test.exe \
slist-test.exe \
spawn-test.exe \
# strfunc-test doesn't compile with MSVC
@ -47,7 +69,9 @@ TESTS = \
type-test.exe \
unicode-caseconv.exe \
unicode-encoding.exe \
uri-test.exe
utf8-validate.exe \
utf8-pointer.exe \
uri-test.exe \
DLLS = \
libmoduletestplugin_a.dll \
@ -59,6 +83,10 @@ all : $(TESTS) $(NONAUTOMATIC_TESTS) $(DLLS)
$(CC) $(CFLAGS) -c $<
$(CC) $(CFLAGS) -Fe$@ $< ..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
slice-test.exe : memchunks.obj slice-test.obj
$(CC) $(CFLAGS) -Fe$@ memchunks.obj slice-test.obj \
..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
libmoduletestplugin_a.dll : libmoduletestplugin_a.obj
$(CC) $(CFLAGS) -LD libmoduletestplugin_a.obj ..\gmodule\gmodule-2.0.lib ..\glib\glib-2.0.lib $(LDFLAGS)

View File

@ -16,10 +16,13 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <signal.h>

View File

@ -432,8 +432,8 @@ arg_test6 (void)
g_assert (retval);
/* Last arg specified is the one that should be stored */
g_assert (arg_test6_int64 == 4294967296LL);
g_assert (arg_test6_int64_2 == 0xfffffffffLL);
g_assert (arg_test6_int64 == G_GINT64_CONSTANT(4294967296));
g_assert (arg_test6_int64_2 == G_GINT64_CONSTANT(0xfffffffff));
g_strfreev (argv);
g_option_context_free (context);

View File

@ -87,7 +87,7 @@ verbose (const gchar *format, ...)
va_end (args);
if (noisy)
g_print (msg);
g_print ("%s", msg);
g_free (msg);
}
@ -230,8 +230,8 @@ test_match_simple (const gchar *pattern,
gboolean expected)
{
gboolean match;
verbose ("matching \"%s\" against \"%s\" \t", string, pattern);
verbose ("matching \"%s\" against \"%s\" \t", string, pattern);
match = g_regex_match_simple (pattern, string, compile_opts, match_opts);
if (match != expected)
@ -274,8 +274,12 @@ test_match (const gchar *pattern,
match = g_regex_match_full (regex, string, string_len,
start_position, match_opts2, NULL);
if (match != expected)
{
g_print ("failed \t(unexpected %s)\n", match ? "match" : "mismatch");
{
gchar *e1 = g_strescape (pattern, NULL);
gchar *e2 = g_strescape (string, NULL);
g_print ("failed \t(unexpected %s) '%s' against '%s'\n", match ? "match" : "mismatch", e1, e2);
g_free (e1);
g_free (e2);
g_regex_free (regex);
return FALSE;
}

View File

@ -60,17 +60,20 @@ touch_mem (guint64 block_size,
guint64 repeats)
{
guint64 j, accu, n = n_blocks;
GTimer *timer;
guint **memc;
guint **memb;
guint **mema = g_new (guint*, n);
for (j = 0; j < n; j++)
mema[j] = g_slice_alloc (block_size);
guint **memb = g_new (guint*, n);
memb = g_new (guint*, n);
for (j = 0; j < n; j++)
memb[j] = g_slice_alloc (block_size);
guint **memc = g_new (guint*, n);
memc = g_new (guint*, n);
for (j = 0; j < n; j++)
memc[j] = g_slice_alloc (block_size);
GTimer *timer = g_timer_new();
timer = g_timer_new();
fill_memory (mema, n, 2);
fill_memory (memb, n, 3);
fill_memory (memc, n, 4);
@ -148,6 +151,9 @@ parse_memsize (const gchar *cstring)
gchar *string = g_strstrip (mem);
guint l = strlen (string);
gdouble f = 0;
gchar *derr = NULL;
gdouble msize;
switch (l ? string[l - 1] : 0)
{
case 'k': f = 1000; break;
@ -159,8 +165,7 @@ parse_memsize (const gchar *cstring)
}
if (f)
string[l - 1] = 0;
gchar *derr = NULL;
gdouble msize = g_ascii_strtod (string, &derr);
msize = g_ascii_strtod (string, &derr);
g_free (mem);
if (derr && *derr)
{

View File

@ -148,6 +148,10 @@ static gpointer
test_sliced_mem_thread (gpointer data)
{
guint32 rand_accu = 2147483563;
guint i, j;
guint8 **ps;
guint *ss;
/* initialize random numbers */
if (data)
rand_accu = *(guint32*) data;
@ -158,9 +162,8 @@ test_sliced_mem_thread (gpointer data)
rand_accu = rand_tv.tv_usec + (rand_tv.tv_sec << 16);
}
guint i, j;
guint8 **ps = g_new (guint8*, number_of_blocks);
guint *ss = g_new (guint, number_of_blocks);
ps = g_new (guint8*, number_of_blocks);
ss = g_new (guint, number_of_blocks);
/* create number_of_blocks random sizes */
for (i = 0; i < number_of_blocks; i++)
ss[i] = quick_rand32() % prime_size;
@ -267,37 +270,41 @@ main (int argc,
if (argc <= 1)
usage();
gchar strseed[64] = "<random>";
if (seedp)
g_snprintf (strseed, 64, "%u", *seedp);
g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
{
gchar strseed[64] = "<random>";
GThread **threads;
guint i;
if (seedp)
g_snprintf (strseed, 64, "%u", *seedp);
g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
GThread *threads[n_threads];
guint i;
if (!use_memchunks)
for (i = 0; i < n_threads; i++)
threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
else
{
old_mem_chunks_init();
threads = g_alloca (sizeof(GThread*) * n_threads);
if (!use_memchunks)
for (i = 0; i < n_threads; i++)
threads[i] = g_thread_create_full (test_memchunk_thread, seedp, 0, TRUE, FALSE, 0, NULL);
}
for (i = 0; i < n_threads; i++)
g_thread_join (threads[i]);
threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
else
{
old_mem_chunks_init();
for (i = 0; i < n_threads; i++)
threads[i] = g_thread_create_full (test_memchunk_thread, seedp, 0, TRUE, FALSE, 0, NULL);
}
for (i = 0; i < n_threads; i++)
g_thread_join (threads[i]);
if (ccounters)
{
guint n, n_chunks = g_slice_get_config (G_SLICE_CONFIG_CHUNK_SIZES);
g_print (" ChunkSize | MagazineSize | Contention\n");
for (i = 0; i < n_chunks; i++)
{
gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]);
g_free (vals);
}
}
else
g_print ("Done.\n");
return 0;
if (ccounters)
{
guint n, n_chunks = g_slice_get_config (G_SLICE_CONFIG_CHUNK_SIZES);
g_print (" ChunkSize | MagazineSize | Contention\n");
for (i = 0; i < n_chunks; i++)
{
gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]);
g_free (vals);
}
}
else
g_print ("Done.\n");
return 0;
}
}