support for link-time option in #version

Changes to be committed:
	modified:   src/version.c
	modified:   sys/share/cppregex.cpp
	modified:   sys/share/pmatchregex.c
	modified:   sys/share/posixregex.c
	modified:   util/makedefs.c

Some options in 3.6.0 are determined by what you link with.
The choice of regex support is one.
Let #version show that linked option along with the compile-time options.
This commit is contained in:
nhmall
2015-06-12 19:23:18 -04:00
parent 5e913f90f8
commit 37f0eafa93
5 changed files with 77 additions and 11 deletions

View File

@@ -10,6 +10,8 @@
extern "C" {
#include <hack.h>
char regex_id[] = "cppregex";
struct nhregex {
std::unique_ptr<std::regex> re;
std::unique_ptr<std::regex_error> err;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 posixregex.c $NHDT-Date: 1432472490 2015/05/24 13:01:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.0 $ */
/* NetHack 3.6 posixregex.c $NHDT-Date: 1434151360 2015/06/12 23:22:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.0 $ */
/* Copyright (c) Sean Hunt 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -16,6 +16,8 @@
* NOTE: This file is untested.
*/
char regex_id[] = "pmatchregex";
struct nhregex {
const char *pat;
};

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 posixregex.c $NHDT-Date: 1431192778 2015/05/09 17:32:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.2 $ */
/* NetHack 3.6 posixregex.c $NHDT-Date: 1434151361 2015/06/12 23:22:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.4 $ */
/* Copyright (c) Sean Hunt 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -44,6 +44,8 @@
* Deallocate a regex object.
*/
char regex_id[] = "posixregex";
struct nhregex {
regex_t re;
int err;