From: Hans Breuer Date: Sat, 17 Mar 2007 09:49:09 +0000 (+0000) Subject: define PCRE_STATIC to reflect the inclusion of pcre as LIB, not X-Git-Tag: GLIB_2_13_1~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=770b29bad2e95f28fda6849e9f9c30560be90cb1;p=platform%2Fupstream%2Fglib.git define PCRE_STATIC to reflect the inclusion of pcre as LIB, not 2007-03-17 Hans Breuer * 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 instead of * 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 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 --- diff --git a/ChangeLog b/ChangeLog index ed27266..abadb95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2007-03-17 Hans Breuer + + * 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 instead of + + * 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 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 * glib/gsequence.[hc]: @@ -42,6 +66,7 @@ Fri Mar 16 11:24:51 2007 Tim Janik * glib/gscanner.c (g_scanner_get_token_ll): Fix a typo in the last commit. (#415323, Richard Hult) +>>>>>>> .r5422 2007-03-15 Tor Lillqvist * glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so diff --git a/glib/gnulib/makefile.msc b/glib/gnulib/makefile.msc index 3d157bb..a8fc743 100644 --- a/glib/gnulib/makefile.msc +++ b/glib/gnulib/makefile.msc @@ -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 $< diff --git a/glib/gregex.h b/glib/gregex.h index b9f8860..1d02147 100644 --- a/glib/gregex.h +++ b/glib/gregex.h @@ -22,7 +22,8 @@ #ifndef __G_REGEX_H__ #define __G_REGEX_H__ -#include +#include +#include G_BEGIN_DECLS diff --git a/glib/makefile.msc.in b/glib/makefile.msc.in index 189a430..0c658f0 100644 --- a/glib/makefile.msc.in +++ b/glib/makefile.msc.in @@ -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 : \ diff --git a/glib/pcre/makefile.msc b/glib/pcre/makefile.msc index 9e4371a..3e4278b 100644 --- a/glib/pcre/makefile.msc +++ b/glib/pcre/makefile.msc @@ -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 $< diff --git a/glib/update-pcre/update.sh b/glib/update-pcre/update.sh index 3c7d13d..3ede49c 100644 --- a/glib/update-pcre/update.sh +++ b/glib/update-pcre/update.sh @@ -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 - -CFLAGS = \\ - -I ..\\.. \\ +TOP = ..\..\.. +!INCLUDE ..\..\build\win32\make.msc + +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 \\ diff --git a/tests/base64-test.c b/tests/base64-test.c index e36b523..4cb7036 100644 --- a/tests/base64-test.c +++ b/tests/base64-test.c @@ -1,6 +1,10 @@ +#include "config.h" + #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #define DATA_SIZE 1024 diff --git a/tests/child-test.c b/tests/child-test.c index 4e46366..b678572 100644 --- a/tests/child-test.c +++ b/tests/child-test.c @@ -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); diff --git a/tests/makefile.msc.in b/tests/makefile.msc.in index 6feb47c..c1f426f 100644 --- a/tests/makefile.msc.in +++ b/tests/makefile.msc.in @@ -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) diff --git a/tests/mapping-test.c b/tests/mapping-test.c index afc520d..1a10b19 100644 --- a/tests/mapping-test.c +++ b/tests/mapping-test.c @@ -16,10 +16,13 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#include "config.h" #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include diff --git a/tests/option-test.c b/tests/option-test.c index 65e1f35..6a84972 100644 --- a/tests/option-test.c +++ b/tests/option-test.c @@ -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); diff --git a/tests/regex-test.c b/tests/regex-test.c index 1c0854d..79b82af 100644 --- a/tests/regex-test.c +++ b/tests/regex-test.c @@ -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; } diff --git a/tests/slice-color.c b/tests/slice-color.c index 85ad62a..c4a417d 100644 --- a/tests/slice-color.c +++ b/tests/slice-color.c @@ -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) { diff --git a/tests/slice-test.c b/tests/slice-test.c index b739650..22f252b 100644 --- a/tests/slice-test.c +++ b/tests/slice-test.c @@ -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] = ""; - 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] = ""; + 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; + } }