From 35015d34d4d47cc9f080696604b421a88734ab46 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Fri, 28 Jun 2013 06:55:57 +0000 Subject: LuaTeX: more inclusion of ptexlib.h first, and guard against it git-svn-id: svn://tug.org/texlive/trunk@30998 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 5 +++++ Build/source/texk/web2c/luatexdir/lang/hyphen.h | 2 -- Build/source/texk/web2c/luatexdir/lang/hyphen.w | 2 +- Build/source/texk/web2c/luatexdir/luatex.h | 4 +--- Build/source/texk/web2c/luatexdir/ptexlib.h | 6 ++++-- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'Build/source/texk/web2c') diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index d9988d63f3b..f068a084c8e 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -2,6 +2,11 @@ * lua/lcallbacklib.c, lua/luainit.w: Replace index() => strchr(). + * ptexlib.h: More general cases for not been included first. + + * lang/hyphen.h: Do not '#include "ptexlib.h"'. + * lang/hyphen.w: Include ptexlib.h instead of lang/hyphen.h. + 2013-06-28 Karl Berry * ptexlib.h: complain if various common things are #defined; diff --git a/Build/source/texk/web2c/luatexdir/lang/hyphen.h b/Build/source/texk/web2c/luatexdir/lang/hyphen.h index 8e5e5785c93..669f2258f7a 100644 --- a/Build/source/texk/web2c/luatexdir/lang/hyphen.h +++ b/Build/source/texk/web2c/luatexdir/lang/hyphen.h @@ -42,8 +42,6 @@ extern "C" { typedef struct _HyphenDict HyphenDict; -# include "ptexlib.h" - HyphenDict *hnj_hyphen_new(void); void hnj_hyphen_load(HyphenDict * dict, const unsigned char *fn); void hnj_hyphen_free(HyphenDict * dict); diff --git a/Build/source/texk/web2c/luatexdir/lang/hyphen.w b/Build/source/texk/web2c/luatexdir/lang/hyphen.w index 99825638fac..b39993fd4be 100644 --- a/Build/source/texk/web2c/luatexdir/lang/hyphen.w +++ b/Build/source/texk/web2c/luatexdir/lang/hyphen.w @@ -42,7 +42,7 @@ static const char _svn_version[] = "$Id: hyphen.w 4599 2013-03-19 15:41:07Z taco $ " "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/lang/hyphen.w $"; -#include "lang/hyphen.h" /* includes ptexlib.h */ +#include "ptexlib.h" #include /* for NULL, malloc */ #include /* for fprintf */ diff --git a/Build/source/texk/web2c/luatexdir/luatex.h b/Build/source/texk/web2c/luatexdir/luatex.h index 592a49a19f7..e5e0e226e5c 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.h +++ b/Build/source/texk/web2c/luatexdir/luatex.h @@ -1,7 +1,7 @@ /* luatex.h Copyright 1996-2006 Han The Thanh - Copyright 2006-2012 Taco Hoekwater + Copyright 2006-2013 Taco Hoekwater This file is part of LuaTeX. @@ -102,8 +102,6 @@ extern void ipcpage(int); extern boolean input_line(FILE *); -# include "ptexlib.h" - # define COPYRIGHT_HOLDER "Taco Hoekwater" # define AUTHOR NULL # define PROGRAM_HELP LUATEXHELP diff --git a/Build/source/texk/web2c/luatexdir/ptexlib.h b/Build/source/texk/web2c/luatexdir/ptexlib.h index d983011771f..f313e6c03e1 100644 --- a/Build/source/texk/web2c/luatexdir/ptexlib.h +++ b/Build/source/texk/web2c/luatexdir/ptexlib.h @@ -23,7 +23,10 @@ #ifndef PTEXLIB_H # define PTEXLIB_H -#if defined (_OFF_T_DEFINED) || defined (EOF) || defined (assert) || defined (_FEATURES_H) +/* Try to detect if a system header has already been included. */ +#if (defined(__linux__) && defined(_FEATURES_H)) || \ + (defined(_MSC_VER) && (defined(_INC_CRTDEFS) || defined(_OFF_T_DEFINED))) || \ + (defined(__MINGW32__) && defined(__MINGW_H)) ptexlib.h must be included first!!! #endif @@ -32,7 +35,6 @@ ptexlib.h must be included first!!! #endif /* WEB2C macros and prototypes */ -# define EXTERN extern # include "luatex.h" # include "lib/lib.h" -- cgit v1.2.3