summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-09-02 07:02:00 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-09-02 07:02:00 +0000
commitffe0571cfeed11aff6873c2a6337b678f06cac11 (patch)
treeb1fee9844b8308ad9ff91a66d2684d97bc0b240f /Build/source/texk/web2c
parentd67729aa4d5897be113d62b655d4b63173a918fa (diff)
luaTeX: Remove all g++ warnings
git-svn-id: svn://tug.org/texlive/trunk@38274 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog4
-rw-r--r--Build/source/texk/web2c/c-auto.in3
-rwxr-xr-xBuild/source/texk/web2c/configure45
-rw-r--r--Build/source/texk/web2c/configure.ac16
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lepdflib.cc24
6 files changed, 90 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index a44c8ecbd8f..8aaf0ba33b5 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * configure.ac: Check poppler for Object::initCmd(const char*).
+
2015-08-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: Drop check for <StructTreeRoot.h>, we now
diff --git a/Build/source/texk/web2c/c-auto.in b/Build/source/texk/web2c/c-auto.in
index 8166e0e43af..ce18d89e49b 100644
--- a/Build/source/texk/web2c/c-auto.in
+++ b/Build/source/texk/web2c/c-auto.in
@@ -139,6 +139,9 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if you have the `Object::initCmd(const char*)' function. */
+#undef HAVE_OBJECT_INITCMD_CONST_CHARP
+
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure
index c2bd3d449fa..e8b1a612345 100755
--- a/Build/source/texk/web2c/configure
+++ b/Build/source/texk/web2c/configure
@@ -24457,6 +24457,51 @@ else
KPATHSEA_PATHS_H='${top_builddir}/..'
fi
+
+eval CPPFLAGS=\"$POPPLER_INCLUDES \$CPPFLAGS\"
+eval LIBS=\"$POPPLER_LIBS \$LIBS\"
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ac_link="./libtool --mode=link --tag=CXX $ac_link"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Object::initCmd(const char*) etc" >&5
+$as_echo_n "checking for Object::initCmd(const char*) etc... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <Object.h>
+int
+main ()
+{
+Object *obj; const char *name;
+obj->initCmd(name)->isStream(name);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ kpse_cv_have_Object_initCmd_const_charp=yes
+else
+ kpse_cv_have_Object_initCmd_const_charp=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_Object_initCmd_const_charp" >&5
+$as_echo "$kpse_cv_have_Object_initCmd_const_charp" >&6; }
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_link="./libtool --mode=link --tag=CC $ac_link"
+
+if test "x$kpse_cv_have_Object_initCmd_const_charp" = xyes; then
+
+$as_echo "#define HAVE_OBJECT_INITCMD_CONST_CHARP 1" >>confdefs.h
+
+fi
CPPFLAGS=$kpse_save_CPPFLAGS
LIBS=$kpse_save_LIBS
diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac
index cc52b7cc7ff..c6cd65893fe 100644
--- a/Build/source/texk/web2c/configure.ac
+++ b/Build/source/texk/web2c/configure.ac
@@ -283,6 +283,22 @@ else
KPATHSEA_PATHS_H='${top_builddir}/..'
fi
AC_SUBST([KPATHSEA_PATHS_H])
+
+dnl Check for Object::initCmd(const char *) etc
+KPSE_ADD_FLAGS([poppler])
+AC_LANG_PUSH([C++])
+AC_MSG_CHECKING([for Object::[initCmd(const char*)] etc])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Object.h>]],
+ [[Object *obj; const char *name;
+obj->initCmd(name)->isStream(name);]])],
+ [kpse_cv_have_Object_initCmd_const_charp=yes],
+ [kpse_cv_have_Object_initCmd_const_charp=no])
+AC_MSG_RESULT([$kpse_cv_have_Object_initCmd_const_charp])
+AC_LANG_POP([C++])
+if test "x$kpse_cv_have_Object_initCmd_const_charp" = xyes; then
+ AC_DEFINE([HAVE_OBJECT_INITCMD_CONST_CHARP], 1,
+ [Define to 1 if you have the `Object::initCmd(const char*)' function.])
+fi
KPSE_RESTORE_FLAGS
dnl Write output here, instead of putting a zillion -D's on the command line.
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 18badf6c886..6aabd31036b 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * lua/lepdflib.cc: Drop useless casts 'const char *' -> 'char *'
+ when poppler has Object::initCmd(const char*).
+
2015-08-31 Peter Breitenlohner <peb@mppmu.mpg.de>
* lua/lepdflib.cc: Bugfix: m_Object_dictAdd() must use a copy of
diff --git a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
index cb1795bdf38..b05e44a4d6b 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
+++ b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -1279,8 +1279,16 @@ static const struct luaL_Reg Links_m[] = {
//**********************************************************************
// Object
+#ifdef HAVE_OBJECT_INITCMD_CONST_CHARP
+#define CHARP_CAST
+#else
+// must cast arg of Object::initCmd, Object::isStream, and Object::streamIs
+// from 'const char *' to 'char *', although they are not modified.
+#define CHARP_CAST (char *)
+#endif
+
// Special type checking.
-#define m_Object_isType(function, cast) \
+#define m_Object_isType_(function, cast) \
static int m_Object_##function(lua_State * L) \
{ \
udstruct *uin; \
@@ -1301,6 +1309,8 @@ static int m_Object_##function(lua_State * L) \
} \
return 1; \
}
+#define m_Object_isType(function) m_Object_isType_(function, )
+#define m_Object_isType_nonconst(function) m_Object_isType_(function, CHARP_CAST)
static int m_Object_initBool(lua_State * L)
{
@@ -1444,7 +1454,7 @@ static int m_Object_initCmd(lua_State * L)
if (uin->pd != NULL && uin->pd->pc != uin->pc)
pdfdoc_changed_error(L);
s = luaL_checkstring(L, 2);
- ((Object *) uin->d)->initCmd((char *) s);
+ ((Object *) uin->d)->initCmd(CHARP_CAST s);
return 0;
}
@@ -1514,13 +1524,13 @@ m_poppler_get_BOOL(Object, isInt);
m_poppler_get_BOOL(Object, isReal);
m_poppler_get_BOOL(Object, isNum);
m_poppler_get_BOOL(Object, isString);
-m_Object_isType(isName, );
+m_Object_isType(isName);
m_poppler_get_BOOL(Object, isNull);
m_poppler_get_BOOL(Object, isArray);
-m_Object_isType(isDict, );
-m_Object_isType(isStream, (char *));
+m_Object_isType(isDict);
+m_Object_isType_nonconst(isStream);
m_poppler_get_BOOL(Object, isRef);
-m_Object_isType(isCmd, );
+m_Object_isType(isCmd);
m_poppler_get_BOOL(Object, isError);
m_poppler_get_BOOL(Object, isEOF);
m_poppler_get_BOOL(Object, isNone);
@@ -1964,7 +1974,7 @@ static int m_Object_streamIs(lua_State * L)
pdfdoc_changed_error(L);
s = luaL_checkstring(L, 2);
if (((Object *) uin->d)->isStream()) {
- if (((Object *) uin->d)->streamIs((char *) s))
+ if (((Object *) uin->d)->streamIs(CHARP_CAST s))
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);