summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-29 11:56:02 +0100
committerHaru <haru@dotalux.com>2016-01-29 11:56:02 +0100
commitd1d301737fbdc822665f60a6acbd2e205d15030f (patch)
tree6760de499701dcb440f3d110fcda30a984b54287 /src
parent11a952e03a01ba9e7c9b9d3cd588cddef52082f8 (diff)
parent3b3b21a1b939097b9f96185893a8edf4214bd572 (diff)
downloadhercules-d1d301737fbdc822665f60a6acbd2e205d15030f.tar.gz
hercules-d1d301737fbdc822665f60a6acbd2e205d15030f.tar.bz2
hercules-d1d301737fbdc822665f60a6acbd2e205d15030f.tar.xz
hercules-d1d301737fbdc822665f60a6acbd2e205d15030f.zip
Merge pull request #1108 from 4144/pcreconfigure
Enable pcre by default in configure and show error if pcre missing.
Diffstat (limited to 'src')
-rw-r--r--src/char/Makefile.in4
-rw-r--r--src/common/Makefile.in2
-rw-r--r--src/login/Makefile.in2
-rw-r--r--src/map/Makefile.in4
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/npc.h22
-rw-r--r--src/map/npc_chat.c4
-rw-r--r--src/map/script.c12
-rw-r--r--src/map/script.h2
-rw-r--r--src/plugins/Makefile.in4
-rw-r--r--src/test/Makefile.in4
13 files changed, 10 insertions, 56 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index bc2c0e980..8d9094f18 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -110,13 +110,13 @@ char-server: ../../char-server@EXEEXT@
../../char-server@EXEEXT@: $(CHAR_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
@$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# char object files
obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index df3ecaf2d..9d4b2d044 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -135,7 +135,7 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_
obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index 022831fb5..6560e6497 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -106,7 +106,7 @@ login-server: ../../login-server@EXEEXT@
../../login-server@EXEEXT@: $(LOGIN_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
@$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# login object files
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 60d87522e..b5a3d4461 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -116,13 +116,13 @@ map-server: ../../map-server@EXEEXT@
../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
@$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# map object files
obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/map/clif.c b/src/map/clif.c
index 817579e23..2ec9626f1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9859,10 +9859,8 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
// Chat logging type 'O' / Global Chat
logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
-#ifdef PCRE_SUPPORT
// trigger listening npcs
map->foreachinrange(npc_chat->sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
-#endif
}
void clif_parse_MapMove(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
diff --git a/src/map/map.c b/src/map/map.c
index 1b922148b..3dad25fce 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5774,9 +5774,7 @@ void map_load_defaults(void) {
pet_defaults();
path_defaults();
quest_defaults();
-#ifdef PCRE_SUPPORT
npc_chat_defaults();
-#endif
}
/**
* --run-once handler
diff --git a/src/map/npc.c b/src/map/npc.c
index acecff6d0..ae3cf56d0 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2276,9 +2276,7 @@ int npc_unload(struct npc_data* nd, bool single)
if (nd->chat_id) // remove npc chatroom object and kick users
chat->delete_npc_chat(nd);
-#ifdef PCRE_SUPPORT
npc_chat->finalize(nd); // deallocate npc PCRE data structures
-#endif
if (single && nd->path != NULL) {
npc->releasepathreference(nd->path);
diff --git a/src/map/npc.h b/src/map/npc.h
index 0b2729bcf..568ddfe87 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -309,53 +309,38 @@ void npc_defaults(void);
HPShared struct npc_interface *npc;
/* comes from npc_chat.c */
-#ifdef PCRE_SUPPORT
#include <pcre/include/pcre.h>
-#endif // PCRE_SUPPORT
/**
* Structure containing all info associated with a single pattern block
*/
struct pcrematch_entry {
-#ifdef PCRE_SUPPORT
struct pcrematch_entry* next;
char* pattern;
pcre* pcre_;
pcre_extra* pcre_extra_;
char* label;
-#else // not PCRE_SUPPORT
- UNAVAILABLE_STRUCT;
-#endif // PCRE_SUPPORT
};
/**
* A set of patterns that can be activated and deactived with a single command
*/
struct pcrematch_set {
-#ifdef PCRE_SUPPORT
struct pcrematch_set* prev;
struct pcrematch_set* next;
struct pcrematch_entry* head;
int setid;
-#else // not PCRE_SUPPORT
- UNAVAILABLE_STRUCT;
-#endif // PCRE_SUPPORT
};
/**
* Entire data structure hung off a NPC
*/
struct npc_parse {
-#ifdef PCRE_SUPPORT
struct pcrematch_set* active;
struct pcrematch_set* inactive;
-#else // not PCRE_SUPPORT
- UNAVAILABLE_STRUCT;
-#endif // PCRE_SUPPORT
};
struct npc_chat_interface {
-#ifdef PCRE_SUPPORT
int (*sub) (struct block_list* bl, va_list ap);
void (*finalize) (struct npc_data* nd);
void (*def_pattern) (struct npc_data* nd, int setid, const char* pattern, const char* label);
@@ -365,9 +350,6 @@ struct npc_chat_interface {
void (*activate_pcreset) (struct npc_data* nd, int setid);
struct pcrematch_set* (*lookup_pcreset) (struct npc_data* nd, int setid);
void (*finalize_pcrematch_entry) (struct pcrematch_entry* e);
-#else // not PCRE_SUPPORT
- UNAVAILABLE_STRUCT;
-#endif // PCRE_SUPPORT
};
/**
@@ -376,7 +358,6 @@ struct npc_chat_interface {
* should be moved into core/perhaps its own file once hpm is enhanced for login/char
**/
struct pcre_interface {
-#ifdef PCRE_SUPPORT
pcre *(*compile) (const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);
pcre_extra *(*study) (const pcre *code, int options, const char **errptr);
int (*exec) (const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize);
@@ -385,9 +366,6 @@ struct pcre_interface {
void (*free_substring) (const char *stringptr);
int (*copy_named_substring) (const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);
int (*get_substring) (const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);
-#else // not PCRE_SUPPORT
- UNAVAILABLE_STRUCT;
-#endif // PCRE_SUPPORT
};
/**
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index fef3ba99b..001baf3ea 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -20,8 +20,6 @@
*/
#define HERCULES_CORE
-#ifdef PCRE_SUPPORT
-
#include "npc.h" // struct npc_data
#include "map/mob.h" // struct mob_data
@@ -470,5 +468,3 @@ void npc_chat_defaults(void) {
libpcre->copy_named_substring = pcre_copy_named_substring;
libpcre->get_substring = pcre_get_substring;
}
-
-#endif //PCRE_SUPPORT
diff --git a/src/map/script.c b/src/map/script.c
index ca53b6f6d..64bdba592 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -159,10 +159,8 @@ const char* script_op2name(int op) {
RETURN_OP_NAME(C_SUB_POST);
RETURN_OP_NAME(C_ADD_PRE);
RETURN_OP_NAME(C_SUB_PRE);
-#ifdef PCRE_SUPPORT
RETURN_OP_NAME(C_RE_EQ);
RETURN_OP_NAME(C_RE_NE);
-#endif // PCRE_SUPPORT
default:
ShowDebug("script_op2name: unexpected op=%d\n", op);
@@ -1446,10 +1444,8 @@ const char* script_parse_subexpr(const char* p,int limit)
|| (op=C_XOR, opl=4, len=1,*p=='^') // ^
|| (op=C_EQ, opl=6, len=2,*p=='=' && p[1]=='=') // ==
|| (op=C_NE, opl=6, len=2,*p=='!' && p[1]=='=') // !=
-#ifdef PCRE_SUPPORT
|| (op=C_RE_EQ, opl=6, len=2,*p=='~' && p[1]=='=') // ~=
|| (op=C_RE_NE, opl=6, len=2,*p=='~' && p[1]=='!') // ~!
-#endif // PCRE_SUPPORT
|| (op=C_R_SHIFT,opl=8, len=2,*p=='>' && p[1]=='>') // >>
|| (op=C_GE, opl=7, len=2,*p=='>' && p[1]=='=') // >=
|| (op=C_GT, opl=7, len=1,*p=='>') // >
@@ -3761,7 +3757,6 @@ void op_2str(struct script_state* st, int op, const char* s1, const char* s2)
case C_GE: a = (strcmp(s1,s2) >= 0); break;
case C_LT: a = (strcmp(s1,s2) < 0); break;
case C_LE: a = (strcmp(s1,s2) <= 0); break;
-#ifdef PCRE_SUPPORT
case C_RE_EQ:
case C_RE_NE:
{
@@ -3826,7 +3821,6 @@ void op_2str(struct script_state* st, int op, const char* s1, const char* s2)
libpcre->free(extra_regex);
}
break;
-#endif // PCRE_SUPPORT
case C_ADD:
{
char* buf = (char *)aMalloc((strlen(s1)+strlen(s2)+1)*sizeof(char));
@@ -4423,10 +4417,8 @@ void run_script_main(struct script_state *st) {
case C_LOR:
case C_R_SHIFT:
case C_L_SHIFT:
-#ifdef PCRE_SUPPORT
case C_RE_EQ:
case C_RE_NE:
-#endif // PCRE_SUPPORT
script->op_2(st, c);
break;
@@ -20129,7 +20121,6 @@ BUILDIN(_) {
}
// declarations that were supposed to be exported from npc_chat.c
-#ifdef PCRE_SUPPORT
BUILDIN(defpattern);
BUILDIN(activatepset);
BUILDIN(deactivatepset);
@@ -20142,7 +20133,6 @@ BUILDIN(pcre_match) {
script->op_2str(st, C_RE_EQ, input, regex);
return true;
}
-#endif
/**
* Adds a built-in script function.
@@ -20559,13 +20549,11 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getrefine,""), // returns the refined number of the current item, or an item with index specified [celest]
BUILDIN_DEF(night,""), // sets the server to night time
BUILDIN_DEF(day,""), // sets the server to day time
-#ifdef PCRE_SUPPORT
BUILDIN_DEF(defpattern,"iss"), // Define pattern to listen for [MouseJstr]
BUILDIN_DEF(activatepset,"i"), // Activate a pattern set [MouseJstr]
BUILDIN_DEF(deactivatepset,"i"), // Deactive a pattern set [MouseJstr]
BUILDIN_DEF(deletepset,"i"), // Delete a pattern set [MouseJstr]
BUILDIN_DEF(pcre_match,"ss"),
-#endif
BUILDIN_DEF(dispbottom,"s?"), //added from jA [Lupus]
BUILDIN_DEF(getusersname,""),
BUILDIN_DEF(recovery,""),
diff --git a/src/map/script.h b/src/map/script.h
index e6164092e..351ccd02a 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -233,10 +233,8 @@ typedef enum c_op {
C_SUB_POST, // a--
C_ADD_PRE, // ++a
C_SUB_PRE, // --a
-#ifdef PCRE_SUPPORT
C_RE_EQ, // ~=
C_RE_NE, // ~!
-#endif // PCRE_SUPPORT
} c_op;
/// Script queue options
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 6e8e3bfac..3fe38b6bc 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -102,7 +102,7 @@ Makefile: Makefile.in
../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null)
@echo " CC $<"
- @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @PCRE_CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
+ @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
../../plugins/HPMHooking_login@DLLEXT@: HPMHOOKINGTYPE = LOGIN
../../plugins/HPMHooking_char@DLLEXT@: HPMHOOKINGTYPE = CHAR
@@ -110,4 +110,4 @@ Makefile: Makefile.in
../../plugins/HPMHooking_%@DLLEXT@: HPMHooking.c $(ALL_H) $$(shell ls HPMHooking/*_%* HPMHooking/*_common* 2>/dev/null)
@echo " CC $< ($(HPMHOOKINGTYPE))"
- @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @PCRE_CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
+ @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 29331cb0f..6d2187733 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -88,13 +88,13 @@ $(TESTS_ALL): test_%: ../../test_%@EXEEXT@
../../test_%@EXEEXT@: obj/test_%.o $(TEST_DEPENDS) Makefile
@echo " LD $(notdir $@)"
@$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# object files
obj/%.o: %.c $(TEST_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a: