Merge branch 'master' into win32-x64-working
Conflicts: src/files.c src/potion.c sys/winnt/Makefile.msc Changes to be committed: modified: .gitignore modified: DEVEL/hooksdir/nhsub modified: dat/.gitignore modified: dat/opthelp modified: doc/Guidebook.mn modified: doc/Guidebook.tex modified: doc/fixes35.0 modified: include/context.h modified: include/decl.h modified: include/extern.h modified: include/flag.h modified: include/hack.h modified: include/patchlevel.h modified: src/apply.c modified: src/attrib.c modified: src/decl.c modified: src/do.c modified: src/do_name.c modified: src/dothrow.c modified: src/eat.c modified: src/files.c modified: src/hack.c modified: src/invent.c modified: src/lock.c modified: src/mklev.c modified: src/mondata.c modified: src/monmove.c modified: src/music.c modified: src/options.c modified: src/potion.c modified: src/pray.c modified: src/sit.c modified: src/sp_lev.c modified: src/uhitm.c modified: sys/share/posixregex.c modified: sys/winnt/Makefile.msc modified: util/.gitignore modified: win/win32/vs2010/NetHackW.vcxproj
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/* NetHack 3.5 posixregex.c $NHDT-Date: 1428590280 2015/04/09 14:38:00 $ $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.0 $ */
|
||||
/* NetHack 3.5 posixregex.c $NHDT-Date: 1428970913 2015/04/14 00:21:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.0 $ */
|
||||
/* Copyright (c) Sean Hunt 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include <hack.h>
|
||||
#include "hack.h"
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
@@ -50,7 +50,7 @@ struct nhregex {
|
||||
};
|
||||
|
||||
struct nhregex *regex_init() {
|
||||
return malloc (sizeof (struct nhregex));
|
||||
return (struct nhregex *)alloc(sizeof (struct nhregex));
|
||||
}
|
||||
|
||||
boolean regex_compile(const char *s, struct nhregex *re) {
|
||||
@@ -65,7 +65,7 @@ const char *regex_error_desc(struct nhregex *re) {
|
||||
static char buf[BUFSZ];
|
||||
|
||||
if (!re || !re->err)
|
||||
return NULL;
|
||||
return (const char *)0;
|
||||
|
||||
/* FIXME: Using a static buffer here is not ideal, but avoids memory
|
||||
* leaks. Consider the allocation more carefully. */
|
||||
@@ -75,11 +75,12 @@ const char *regex_error_desc(struct nhregex *re) {
|
||||
}
|
||||
|
||||
boolean regex_match(const char *s, struct nhregex *re) {
|
||||
int result;
|
||||
|
||||
if (!re)
|
||||
return FALSE;
|
||||
|
||||
int result;
|
||||
if ((result = regexec(&re->re, s, 0, NULL, 0))) {
|
||||
if ((result = regexec(&re->re, s, 0, (genericptr_t)0, 0))) {
|
||||
if (result != REG_NOMATCH)
|
||||
re->err = result;
|
||||
return FALSE;
|
||||
|
||||
@@ -142,63 +142,6 @@ rc=Rc
|
||||
TARGET_CPU=x86
|
||||
!ENDIF
|
||||
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations)
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -Ox - use maximum optimizations
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
# -GS - enable security checks
|
||||
#
|
||||
ccommon=-c -Zi -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
|
||||
lflags=/INCREMENTAL:NO /NOLOGO
|
||||
|
||||
!IF "$(TARGET_CPU)" == "x86"
|
||||
cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3
|
||||
scall = -Gz
|
||||
|
||||
!ELSEIF "$(TARGET_CPU)" == "x64"
|
||||
cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32
|
||||
cflags = $(cflags) -W4
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on Intel x86 systems
|
||||
!IF "$(TARGET_CPU)" == "x86"
|
||||
DLLENTRY = @12
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on AMD64 systems
|
||||
!IF "$(TARGET_CPU)" == "x64"
|
||||
DLLENTRY =
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications
|
||||
conlflags = $(lflags) -subsystem:console,$(EXEVER)
|
||||
guilflags = $(lflags) -subsystem:windows,$(EXEVER)
|
||||
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = $(baselibs)
|
||||
guilibs = $(winlibs)
|
||||
#
|
||||
# End of VS2013 and greater stuff
|
||||
#=============================================
|
||||
|
||||
#
|
||||
#=============================================
|
||||
# Visual Studio versions >= 2013 specific stuff
|
||||
#=============================================
|
||||
|
||||
!IF "$(TARGET_CPU)" == ""
|
||||
TARGET_CPU=x86
|
||||
!ENDIF
|
||||
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations)
|
||||
@@ -413,7 +356,7 @@ lflagsUtil = $(lflags) $(conlibs)
|
||||
# - Game build
|
||||
#==========================================
|
||||
|
||||
GAMEPDBFILE= /DEBUG /PDB:"$(O)$(GAME).PDB"
|
||||
GAMEPDBFILE= /PDB:"$(O)$(GAME).PDB"
|
||||
GAMEMAPFILE= /MAP:"$(O)$(GAME).MAP"
|
||||
LIBS= user32.lib winmm.lib $(ZLIB)
|
||||
|
||||
@@ -588,7 +531,6 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
|
||||
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
|
||||
VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o
|
||||
VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o
|
||||
|
||||
DLBOBJ = $(O)dlb.o
|
||||
|
||||
REGEX = $(O)cppregex.o
|
||||
|
||||
Reference in New Issue
Block a user