From 8afa9559a6e26cff5a3cf5e74d39c844ccd63747 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 14 Apr 2007 15:58:58 +0000 Subject: Tweaked CLUA_BINDINGS so that the only thing it controls is running user scripts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1309 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/AppHdr.h | 8 +++++++- crawl-ref/source/Kills.cc | 3 --- crawl-ref/source/clua.cc | 4 ---- crawl-ref/source/clua.h | 4 ---- crawl-ref/source/command.cc | 2 +- crawl-ref/source/food.cc | 2 -- crawl-ref/source/stash.cc | 2 -- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index 8bad5c10e4..42c371f581 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -48,7 +48,9 @@ # define HASH_CONTAINERS #endif -// Uncomment to enable the Crawl Lua bindings. +// Uncomment to enable the Crawl Lua bindings. You can also set this in your +// makefile by adding -DCLUA_BINDINGS to the CFLAGS line (this is preferred to +// editing AppHdr.h directly). // // #define CLUA_BINDINGS @@ -233,6 +235,10 @@ #define DGL_MACRO_ABSOLUTE_PATH #endif +#if defined(REGEX_POSIX) && defined(REGEX_PCRE) +#error You can use either REGEX_POSIX or REGEX_PCRE, or neither, but not both. +#endif + // ========================================================================= // Debugging Defines // ========================================================================= diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc index 8f16ef81cc..3f63c529fc 100644 --- a/crawl-ref/source/Kills.cc +++ b/crawl-ref/source/Kills.cc @@ -701,7 +701,6 @@ void kill_monster_desc::load(FILE *file) modifier = (name_modifier) readShort(file); } -#ifdef CLUA_BINDINGS /////////////////////////////////////////////////////////////////////////// // Kill Lua interface // @@ -1019,5 +1018,3 @@ static void kill_lua_filltable(std::vector &v) lua_rawseti(ls, -2, i + 1); } } - -#endif diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 402ab80531..326a91ff73 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -4,8 +4,6 @@ #include "AppHdr.h" -#ifdef CLUA_BINDINGS - #include "clua.h" #include "abl-show.h" @@ -2325,5 +2323,3 @@ bool lua_text_pattern::translate() const return translated; } - -#endif // CLUA_BINDINGS diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index 88f0f45cc0..ab4ec6878f 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -3,8 +3,6 @@ #include "AppHdr.h" -#ifdef CLUA_BINDINGS - extern "C" { #include #include @@ -117,6 +115,4 @@ extern CLua clua; void lua_set_exclusive_item(const item_def *item = NULL); -#endif // CLUA_BINDINGS - #endif diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 6efd53eb59..ad79d1168d 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -58,7 +58,7 @@ static const char *features[] = { "Stash-tracking", #ifdef CLUA_BINDINGS - "Lua", + "Lua user scripts", #endif #if defined(REGEX_POSIX) diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 185b83185e..ba6c1539d2 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -348,7 +348,6 @@ bool butchery(void) return false; } // end butchery() -#ifdef CLUA_BINDINGS void lua_push_items(lua_State *ls, int link) { lua_newtable(ls); @@ -380,7 +379,6 @@ void lua_push_inv_items(lua_State *ls = NULL) } } } -#endif static bool userdef_eat_food() { diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 8f08374c36..dcac179e8b 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -1327,12 +1327,10 @@ void StashTracker::search_stashes() text_pattern tpat( csearch, true ); search = &tpat; -#ifdef CLUA_BINDINGS lua_text_pattern ltpat( csearch ); if (lua_text_pattern::is_lua_pattern(csearch)) search = <pat; -#endif if (!search->valid()) { -- cgit v1.2.3-54-g00ecf