From 1a87640a25a3cf2bf77b1cb9c69e3c90f2b3811b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 12 Apr 2009 23:15:36 +0000
Subject: oberdiek update (12apr09)

git-svn-id: svn://tug.org/texlive/trunk@12705 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/generic/oberdiek/ifluatex.sty   | 68 ++++++++++++++++++++--
 1 file changed, 64 insertions(+), 4 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty')

diff --git a/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty
index 7272b7eeaa7..30e604e2c7e 100644
--- a/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty
+++ b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
+%% Copyright (C) 2007, 2009 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either
@@ -25,7 +25,7 @@
 %% This work consists of the main source file ifluatex.dtx
 %% and the derived files
 %%    ifluatex.sty, ifluatex.pdf, ifluatex.ins, ifluatex.drv,
-%%    ifluatex-test1.tex.
+%%    ifluatex-test1.tex, ifluatex-test2.tex, ifluatex-test3.tex.
 %% 
 \begingroup
   \catcode44 12 % ,
@@ -78,6 +78,9 @@
   \else
     \def\x#1#2[#3]{\endgroup
       #2[{#3}]%
+      \ifx#1\@undefined
+        \xdef#1{#3}%
+      \fi
       \ifx#1\relax
         \xdef#1{#3}%
       \fi
@@ -85,7 +88,7 @@
   \fi
 \expandafter\x\csname ver@ifluatex.sty\endcsname
 \ProvidesPackage{ifluatex}%
-  [2007/12/12 v1.0 Provides the ifluatex switch (HO)]
+  [2009/04/10 v1.1 Provides the ifluatex switch (HO)]
 \begingroup
   \catcode123 1 % {
   \catcode125 2 % }
@@ -110,6 +113,9 @@
   \catcode#1 #2\relax
 }
 \TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
 \TMP@EnsureCode{44}{12}% ,
 \TMP@EnsureCode{45}{12}% -
 \TMP@EnsureCode{46}{12}% .
@@ -117,6 +123,7 @@
 \TMP@EnsureCode{58}{12}% :
 \TMP@EnsureCode{61}{12}% =
 \TMP@EnsureCode{94}{7}% ^
+\TMP@EnsureCode{96}{12}% `
 \begingroup
   \expandafter\ifx\csname ifluatex\endcsname\relax
   \else
@@ -144,12 +151,65 @@
     \expandafter\endinput
   \fi
 \endgroup
-\newif\ifluatex
+\begingroup
+  \expandafter\ifx\csname newif\endcsname\relax
+    \def\x#1#2{#1}%
+  \else
+    \def\x#1#2{#2}%
+  \fi
+\expandafter\endgroup\x
+{%
+  \let\ifluatex\iffalse
+  \def\luatextrue{%
+    \let\ifluatex\iftrue
+  }%
+  \def\luatexfalse{%
+    \let\luatexfalse
+  }%
+}{%
+  \csname newif\endcsname\ifluatex
+}
 \begingroup\expandafter\expandafter\expandafter\endgroup
 \expandafter\ifx\csname luatexversion\endcsname\relax
 \else
   \luatextrue
 \fi
+\ifluatex
+\else
+  \begingroup\expandafter\expandafter\expandafter\endgroup
+  \expandafter\ifx\csname directlua\endcsname\relax
+  \else
+    \luatextrue
+    \begingroup
+      \newlinechar=10 %
+      \endlinechar=\newlinechar %
+      \ifcase0%
+          \directlua{%
+            if tex.enableprimitives then
+              tex.enableprimitives('ifluatex', {'luatexversion'})
+            else
+              tex.print('1')
+            end
+          }%
+          \ifx\ifluatexluatexversion\@undefined 1\fi %
+          \relax %
+        \global\let\luatexversion\ifluatexluatexversion
+      \else %
+        \expandafter\ifx\csname PackageError\endcsname\relax %
+          \def\PackageError#1#2#3{%
+            \errhelp{#3}%
+            \errmessage{Package `#1' Error: #2}%
+          }%
+        \fi %
+        \PackageError{ifluatex}{%
+          Missing \string\luatexversion%
+        }{%
+          Update LuaTeX.%
+        }%
+      \fi %
+    \endgroup %
+  \fi
+\fi
 \begingroup
   \expandafter\ifx\csname PackageInfo\endcsname\relax
     \def\x#1#2{%
-- 
cgit v1.2.3

