finish implementing pmatchregex
I started out cleaning up a bit of lint in the recent run-time options handling and discovered that pmatchregex wasn't finished. Finish it and also deal with the version lint. Argument declarations for function definitions in pmatchregex.c have been switched to K&R style. (The ones in posixregex.c have been left in ANSI style.) There wasn't any build rule for pmatchregex.o; now there is (for Unix). posixregex.o is still the default. There isn't any build rule for cppregex.o (again, for Unix); the change to cppregex.cpp is untested.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
extern "C" {
|
||||
#include <hack.h>
|
||||
|
||||
char regex_id[] = "cppregex";
|
||||
const char regex_id[] = "cppregex";
|
||||
|
||||
struct nhregex {
|
||||
std::unique_ptr<std::regex> re;
|
||||
@@ -25,7 +25,9 @@ extern "C" {
|
||||
if (!re)
|
||||
return FALSE;
|
||||
try {
|
||||
re->re.reset(new std::regex(s, std::regex::extended | std::regex::nosubs | std::regex::optimize));
|
||||
re->re.reset(new std::regex(s, (std::regex::extended
|
||||
| std::regex::nosubs
|
||||
| std::regex::optimize)));
|
||||
re->err.reset(nullptr);
|
||||
return TRUE;
|
||||
} catch (const std::regex_error& err) {
|
||||
|
||||
Reference in New Issue
Block a user