2010-07-22  Jonathan Yong  <jon_y@users.sourceforge.net>

        *src/gendef.c (decode_mangle): Rename sGcCtx to libmangle_gc_context.
        Rename pMToken to libmangle_tokens.
        Rename decode_ms_name to libmangle_decode_ms_name.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@2920 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-tools/gendef/ChangeLog b/mingw-w64-tools/gendef/ChangeLog
index 81fbb61..3fadcf5 100644
--- a/mingw-w64-tools/gendef/ChangeLog
+++ b/mingw-w64-tools/gendef/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-22  Jonathan Yong  <jon_y@users.sourceforge.net>
+
+	*src/gendef.c (decode_mangle): Rename sGcCtx to libmangle_gc_context.
+	Rename pMToken to libmangle_tokens.
+	Rename decode_ms_name to libmangle_decode_ms_name.
+
 2010-05-01  Jonathan Yong  <jon_y@users.sourceforge.net>
 
 	* src/fsredir.h (doredirect): Declare.
diff --git a/mingw-w64-tools/gendef/configure b/mingw-w64-tools/gendef/configure
index ca488c3..6ce0f99 100755
--- a/mingw-w64-tools/gendef/configure
+++ b/mingw-w64-tools/gendef/configure
@@ -1734,11 +1734,11 @@
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
+	     enum { N = $2 / 2 - 1 };
 int
 main ()
 {
-static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
-	     0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
 test_array [0] = 0
 
   ;
@@ -1749,11 +1749,11 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
+	        enum { N = $2 / 2 - 1 };
 int
 main ()
 {
-static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
-		($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
 		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
 test_array [0] = 0
 
@@ -4332,9 +4332,9 @@
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for print_decl in -lmangle" >&5
-$as_echo_n "checking for print_decl in -lmangle... " >&6; }
-if test "${ac_cv_lib_mangle_print_decl+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmangle_print_decl in -lmangle" >&5
+$as_echo_n "checking for libmangle_print_decl in -lmangle... " >&6; }
+if test "${ac_cv_lib_mangle_libmangle_print_decl+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -4348,27 +4348,27 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char print_decl ();
+char libmangle_print_decl ();
 int
 main ()
 {
-return print_decl ();
+return libmangle_print_decl ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_mangle_print_decl=yes
+  ac_cv_lib_mangle_libmangle_print_decl=yes
 else
-  ac_cv_lib_mangle_print_decl=no
+  ac_cv_lib_mangle_libmangle_print_decl=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mangle_print_decl" >&5
-$as_echo "$ac_cv_lib_mangle_print_decl" >&6; }
-if test "x$ac_cv_lib_mangle_print_decl" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mangle_libmangle_print_decl" >&5
+$as_echo "$ac_cv_lib_mangle_libmangle_print_decl" >&6; }
+if test "x$ac_cv_lib_mangle_libmangle_print_decl" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBMANGLE 1
 _ACEOF
diff --git a/mingw-w64-tools/gendef/configure.ac b/mingw-w64-tools/gendef/configure.ac
index eacf99d..10122ce 100644
--- a/mingw-w64-tools/gendef/configure.ac
+++ b/mingw-w64-tools/gendef/configure.ac
@@ -32,7 +32,7 @@
     CPPFLAGS="-I$with_mangle_path/include $CPPFLAGS"
     LDFLAGS="-L$with_mangle_path/lib $LDFLAGS"])
   AC_CHECK_HEADER([libmangle.h],[],[AC_MSG_ERROR([libmangle enabled, but the header is not usable.])])
-  AC_CHECK_LIB([mangle],[print_decl],[],[AC_MSG_ERROR([libmangle enabled, but the library is not usable.])])])
+  AC_CHECK_LIB([mangle],[libmangle_print_decl],[],[AC_MSG_ERROR([libmangle enabled, but the library is not usable.])])])
 
 # Checks for header files.
 AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h string.h])
diff --git a/mingw-w64-tools/gendef/src/gendef.c b/mingw-w64-tools/gendef/src/gendef.c
index 1fd1738..1201617 100644
--- a/mingw-w64-tools/gendef/src/gendef.c
+++ b/mingw-w64-tools/gendef/src/gendef.c
@@ -1165,22 +1165,22 @@
 decode_mangle (FILE *fp, const char *n)
 {
 #ifdef HAVE_LIBMANGLE
-  sGcCtx *gc = generate_gc ();
-  pMToken ptok;
+  libmangle_gc_context *gc = libmangle_generate_gc ();
+  libmangle_tokens ptok;
 #endif
   if (!fp || !n || *n == 0)
     return;
 #ifdef HAVE_LIBMANGLE
-  ptok = decode_ms_name (gc, n);
+  ptok = libmangle_decode_ms_name (gc, n);
   if (ptok)
     {
-      char *h = sprint_decl (ptok);
+      char *h = libmangle_sprint_decl (ptok);
       if (h)
 	{
 	  fprintf (fp, "; %s\n", h);
 	  free (h);
 	}
     }
-  release_gc (gc);
+  libmangle_release_gc (gc);
 #endif
 }