summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-03-17 11:00:59 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-03-17 11:00:59 +0000
commit87f94469e917f9fa8e90af35d880daeb7f38ec01 (patch)
tree608c6b5e41776ac9e1169ae5ef90d7408819a2d8
parentf305bb496368b3e6c556c84f85d76e22014640c3 (diff)
pdfTeX, XeTeX: Avoid extern decls in C/C++ code, Kpathsea and w2c headers are C++ safe
git-svn-id: svn://tug.org/texlive/trunk@33203 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/Makefile.in42
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftoepdf.cc2
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftosrc.cc2
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog11
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp6
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXFontInst_Mac.cpp6
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp23
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXFontMgr_FC.cpp6
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp10
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp18
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_web.h64
-rw-r--r--Build/source/texk/web2c/xetexdir/am/xetex.am1
-rw-r--r--Build/source/texk/web2c/xetexdir/hz.cpp15
-rw-r--r--Build/source/texk/web2c/xetexdir/pdfimage.cpp6
15 files changed, 112 insertions, 105 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index bc37bc92b5f..da335b20771 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -868,18 +868,18 @@ am__libxetex_a_SOURCES_DIST = xetexdir/MathTable.h \
xetexdir/XeTeXLayoutInterface.cpp \
xetexdir/XeTeXLayoutInterface.h xetexdir/XeTeXOTMath.cpp \
xetexdir/XeTeXOTMath.h xetexdir/XeTeX_ext.c \
- xetexdir/XeTeX_ext.h xetexdir/XeTeX_pic.c xetexdir/XeTeXswap.h \
- xetexdir/trans.c xetexdir/trans.h xetexdir/hz.cpp \
- xetexdir/xetex.h xetexdir/pdfimage.cpp xetexdir/pdfimage.h \
- xetexdir/image/bmpimage.c xetexdir/image/bmpimage.h \
- xetexdir/image/jpegimage.c xetexdir/image/jpegimage.h \
- xetexdir/image/mfileio.c xetexdir/image/mfileio.h \
- xetexdir/image/numbers.c xetexdir/image/numbers.h \
- xetexdir/image/pngimage.c xetexdir/image/pngimage.h \
- xetexdir/XeTeXFontInst_Mac.cpp xetexdir/XeTeXFontInst_Mac.h \
- xetexdir/XeTeXFontMgr_Mac.mm xetexdir/XeTeXFontMgr_Mac.h \
- xetexdir/XeTeX_mac.c xetexdir/XeTeXFontMgr_FC.cpp \
- xetexdir/XeTeXFontMgr_FC.h
+ xetexdir/XeTeX_ext.h xetexdir/XeTeX_pic.c xetexdir/XeTeX_web.h \
+ xetexdir/XeTeXswap.h xetexdir/trans.c xetexdir/trans.h \
+ xetexdir/hz.cpp xetexdir/xetex.h xetexdir/pdfimage.cpp \
+ xetexdir/pdfimage.h xetexdir/image/bmpimage.c \
+ xetexdir/image/bmpimage.h xetexdir/image/jpegimage.c \
+ xetexdir/image/jpegimage.h xetexdir/image/mfileio.c \
+ xetexdir/image/mfileio.h xetexdir/image/numbers.c \
+ xetexdir/image/numbers.h xetexdir/image/pngimage.c \
+ xetexdir/image/pngimage.h xetexdir/XeTeXFontInst_Mac.cpp \
+ xetexdir/XeTeXFontInst_Mac.h xetexdir/XeTeXFontMgr_Mac.mm \
+ xetexdir/XeTeXFontMgr_Mac.h xetexdir/XeTeX_mac.c \
+ xetexdir/XeTeXFontMgr_FC.cpp xetexdir/XeTeXFontMgr_FC.h
@XETEX_MACOSX_TRUE@am__objects_21 = xetexdir/libxetex_a-XeTeXFontInst_Mac.$(OBJEXT) \
@XETEX_MACOSX_TRUE@ xetexdir/libxetex_a-XeTeXFontMgr_Mac.$(OBJEXT) \
@XETEX_MACOSX_TRUE@ xetexdir/libxetex_a-XeTeX_mac.$(OBJEXT)
@@ -3243,15 +3243,15 @@ libxetex_a_SOURCES = xetexdir/MathTable.h xetexdir/XeTeXFontInst.cpp \
xetexdir/XeTeXFontMgr.h xetexdir/XeTeXLayoutInterface.cpp \
xetexdir/XeTeXLayoutInterface.h xetexdir/XeTeXOTMath.cpp \
xetexdir/XeTeXOTMath.h xetexdir/XeTeX_ext.c \
- xetexdir/XeTeX_ext.h xetexdir/XeTeX_pic.c xetexdir/XeTeXswap.h \
- xetexdir/trans.c xetexdir/trans.h xetexdir/hz.cpp \
- xetexdir/xetex.h xetexdir/pdfimage.cpp xetexdir/pdfimage.h \
- xetexdir/image/bmpimage.c xetexdir/image/bmpimage.h \
- xetexdir/image/jpegimage.c xetexdir/image/jpegimage.h \
- xetexdir/image/mfileio.c xetexdir/image/mfileio.h \
- xetexdir/image/numbers.c xetexdir/image/numbers.h \
- xetexdir/image/pngimage.c xetexdir/image/pngimage.h \
- $(am__append_76) $(am__append_77)
+ xetexdir/XeTeX_ext.h xetexdir/XeTeX_pic.c xetexdir/XeTeX_web.h \
+ xetexdir/XeTeXswap.h xetexdir/trans.c xetexdir/trans.h \
+ xetexdir/hz.cpp xetexdir/xetex.h xetexdir/pdfimage.cpp \
+ xetexdir/pdfimage.h xetexdir/image/bmpimage.c \
+ xetexdir/image/bmpimage.h xetexdir/image/jpegimage.c \
+ xetexdir/image/jpegimage.h xetexdir/image/mfileio.c \
+ xetexdir/image/mfileio.h xetexdir/image/numbers.c \
+ xetexdir/image/numbers.h xetexdir/image/pngimage.c \
+ xetexdir/image/pngimage.h $(am__append_76) $(am__append_77)
# We must create xetexd.h etc. before building the libxetex_a_OBJECTS.
libxetex_prereq = xetexd.h $(xetex_dependencies)
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 84571b58dd2..09e444aa600 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * pdftoepdf.cc, pdftosrc.cc: Kpathsea headers and <w2c/config.h>
+ are now C++ safe.
+
2014-03-07 Karl Berry <karl@tug.org>
* pdftex_version.h,
diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
index 736371035c7..43be93d612e 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -21,10 +21,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
MINGW32 <rpcndr.h> defining 'boolean' as 'unsigned char' and
<kpathsea/types.h> defining Pascal's boolean as 'int'.
*/
-extern "C" {
#include <w2c/config.h>
#include <kpathsea/lib.h>
-}
#include <stdlib.h>
#include <math.h>
diff --git a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc
index 0c790e13365..642e12feec1 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc
@@ -16,9 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-extern "C" {
#include <w2c/config.h>
-}
#include <stdlib.h>
#include <stddef.h>
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index eb7657cdf13..ffd761b85d5 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,14 @@
+2014-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * XeTeXFontInst.cpp, XeTeXFontInst_Mac.cpp, XeTeXFontMgr.cpp,
+ XeTeXFontMgr_FC.cpp, XeTeXLayoutInterface.cpp, XeTeXOTMath.cpp,
+ hz.cpp, pdfimage.cpp: <w2c/config.h> is now C++ safe.
+
+ * XeTeXFontMgr.cpp, XeTeXLayoutInterface.cpp, XeTeXOTMath.cpp,
+ hz.cpp: Move extern declarations from the Pascal/WEB side ...
+ * XeTeX_web.h (new): ... to here.
+ * am/xetex.am: Add the new file.
+
2014-02-08 TANAKA Takuji <KXD02663@nifty.ne.jp>
* XeTeX_ext.h: Display output of Unicode characters
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
index cc8267b91bf..5914d1da892 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
@@ -39,13 +39,7 @@ authorization from the copyright holders.
* originally based on PortableFontInstance.cpp from ICU
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include "XeTeXFontInst.h"
#include "XeTeXLayoutInterface.h"
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontInst_Mac.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontInst_Mac.cpp
index b79ba144dc7..4f725631f8f 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXFontInst_Mac.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXFontInst_Mac.cpp
@@ -39,13 +39,7 @@ authorization from the copyright holders.
* created by: Jonathan Kew
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include "XeTeXFontInst_Mac.h"
#include "XeTeX_ext.h"
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
index dcc4a2fba46..d5b80fc59a5 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
@@ -1,7 +1,7 @@
/****************************************************************************\
Part of the XeTeX typesetting system
Copyright (c) 1994-2008 by SIL International
- Copyright (c) 2009-2012 by Jonathan Kew
+ Copyright (c) 2009-2014 by Jonathan Kew
SIL Author(s): Jonathan Kew
@@ -30,13 +30,9 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
+
+#include "XeTeX_web.h"
#ifdef XETEX_MAC
#include "XeTeXFontMgr_Mac.h"
@@ -47,19 +43,6 @@ extern "C" {
#include <hb-ot.h>
-extern "C" {
-extern Fixed loadedfontdesignsize;
-}
-
-// functions from the Pascal/WEB side
-extern "C" {
- void zprintnl(int s);
- void zprintchar(int c);
- void begindiagnostic();
- void zenddiagnostic(int nl);
- int gettracingfontsstate();
-};
-
// see cpascal.h
#define printcstring(STR) \
do { \
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr_FC.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr_FC.cpp
index f7253f1faa3..e69d85e4b5f 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr_FC.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr_FC.cpp
@@ -30,13 +30,7 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include "XeTeXFontMgr_FC.h"
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
index c3e3b7d1b5d..6eae6dbe5d6 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
@@ -2,7 +2,7 @@
Part of the XeTeX typesetting system
Copyright (c) 1994-2008 by SIL International
Copyright (c) 2009-2012 by Jonathan Kew
- Copyright (c) 2012, 2013 by Khaled Hosny
+ Copyright (c) 2012-2014 by Khaled Hosny
SIL Author(s): Jonathan Kew
@@ -31,13 +31,7 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include <unicode/platform.h> // We need this first
#include <unicode/ubidi.h>
@@ -49,6 +43,8 @@ extern "C" {
#include <hb-icu.h>
#include <hb-ot.h>
+#include "XeTeX_web.h"
+
#include "XeTeXLayoutInterface.h"
#include "XeTeXFontInst.h"
#ifdef XETEX_MAC
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp
index f66a23c6fe6..551101e4878 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp
@@ -2,7 +2,7 @@
Part of the XeTeX typesetting system
Copyright (c) 1994-2008 by SIL International
Copyright (c) 2009 by Jonathan Kew
- Copyright (c) 2012 by Khaled Hosny
+ Copyright (c) 2012-2014 by Khaled Hosny
SIL Author(s): Jonathan Kew
@@ -31,31 +31,17 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include <assert.h>
#include "XeTeXOTMath.h"
-#include "XeTeX_ext.h"
+#include "XeTeX_web.h"
#include "XeTeXLayoutInterface.h"
#include "XeTeXFontInst.h"
#include "XeTeXswap.h"
-typedef void* voidptr;
-
-extern "C" {
- extern voidptr* fontlayoutengine;
- extern integer* fontarea;
- extern integer* fontsize;
-}
-
static int32_t getCoverage(const Coverage* coverage, GlyphID g)
{
if (SWAP(coverage->format) == 1) {
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_web.h b/Build/source/texk/web2c/xetexdir/XeTeX_web.h
new file mode 100644
index 00000000000..480d2dabe80
--- /dev/null
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_web.h
@@ -0,0 +1,64 @@
+/****************************************************************************\
+ Part of the XeTeX typesetting system
+ Copyright (c) 1994-2008 by SIL International
+ Copyright (c) 2009-2012 by Jonathan Kew
+ Copyright (c) 2010-2014 by Han The Thanh
+ Copyright (c) 2012-2014 by Khaled Hosny
+ Copyright (c) 2014 by Peter Breitenlohner
+
+ SIL Author(s): Jonathan Kew
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holders
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in this Software without prior written
+authorization from the copyright holders.
+\****************************************************************************/
+
+#ifndef __XETEX_WEB_H
+#define __XETEX_WEB_H
+
+#include <XeTeX_ext.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// declarations from the Pascal/WEB side used in C++ code
+
+extern void zprintnl(int s);
+extern void zprintchar(int c);
+extern void begindiagnostic(void);
+extern void zenddiagnostic(int nl);
+extern int gettracingfontsstate(void);
+extern void set_cp_code(int, unsigned int, int, int);
+extern int get_cp_code(int, unsigned int, int);
+
+extern Fixed loadedfontdesignsize;
+extern void **fontlayoutengine;
+extern integer *fontarea;
+extern integer *fontsize;
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __XETEX_WEB_H */
diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am
index 7952fe1c86a..7307db3e3ce 100644
--- a/Build/source/texk/web2c/xetexdir/am/xetex.am
+++ b/Build/source/texk/web2c/xetexdir/am/xetex.am
@@ -144,6 +144,7 @@ libxetex_a_SOURCES = \
xetexdir/XeTeX_ext.c \
xetexdir/XeTeX_ext.h \
xetexdir/XeTeX_pic.c \
+ xetexdir/XeTeX_web.h \
xetexdir/XeTeXswap.h \
xetexdir/trans.c \
xetexdir/trans.h \
diff --git a/Build/source/texk/web2c/xetexdir/hz.cpp b/Build/source/texk/web2c/xetexdir/hz.cpp
index 927bb3cdf10..113a03f7a28 100644
--- a/Build/source/texk/web2c/xetexdir/hz.cpp
+++ b/Build/source/texk/web2c/xetexdir/hz.cpp
@@ -1,6 +1,6 @@
/****************************************************************************\
Part of the XeTeX typesetting system
- Copyright (c) 2010-2012 by Han The Thanh
+ Copyright (c) 2010-2014 by Han The Thanh
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -27,15 +27,9 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
-#include "XeTeX_ext.h"
+#include "XeTeX_web.h"
#include <map>
#include <iostream>
@@ -46,8 +40,6 @@ typedef pair<int, unsigned int> GlyphId;
typedef map<GlyphId, int> ProtrusionFactor;
ProtrusionFactor leftProt, rightProt;
-extern "C" {
-
void set_cp_code(int fontNum, unsigned int code, int side, int value)
{
GlyphId id(fontNum, code);
@@ -83,6 +75,3 @@ int get_cp_code(int fontNum, unsigned int code, int side)
return it->second;
}
-}
-
-
diff --git a/Build/source/texk/web2c/xetexdir/pdfimage.cpp b/Build/source/texk/web2c/xetexdir/pdfimage.cpp
index a9ccbd02e77..8538913692c 100644
--- a/Build/source/texk/web2c/xetexdir/pdfimage.cpp
+++ b/Build/source/texk/web2c/xetexdir/pdfimage.cpp
@@ -30,13 +30,7 @@ use or other dealings in this Software without prior written
authorization from the copyright holders.
\****************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <w2c/config.h>
-#ifdef __cplusplus
-}
-#endif
#include "XeTeX_ext.h"