$(GAMEDIR)/nhdefkey.dll $(GAMEDIR)/nh340key.dll $(GAMEDIR)/nhraykey.dll
endif
@echo Linking....
- $(link) $(lflags) -o$@ $(ALLOBJ) $(NHRES) $(WINPLIBS) -lstdc++
+ $(link) $(lflags) -o$@ $(ALLOBJ) $(NHRES) $(WINPLIBS) -static -lstdc++
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
$(DAT)/engrave: $(DAT)/engrave.txt $(U)makedefs.exe
$(subst /,\,$(U)makedefs -s)
-$(DAT)\epitaph: $(DAT)/epitaph.txt $(U)makedefs.exe
+$(DAT)/epitaph: $(DAT)/epitaph.txt $(U)makedefs.exe
$(subst /,\,$(U)makedefs -s)
-$(DAT)\bogusmon: $(DAT)/bogusmon.txt $(U)makedefs.exe
+$(DAT)/bogusmon: $(DAT)/bogusmon.txt $(U)makedefs.exe
$(subst /,\,$(U)makedefs -s)
@$(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32)
$(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
- $(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c
+ $(cc) $(CFLAGS) -mno-ms-bitfields -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c
$(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
$(cc) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/til2bm32.c
#include "mhmsgwnd.h"
#include "mhmap.h"
+
+#ifdef __MINGW32__
+/* Force a compilation error if condition is true, but also produce a
+ result (of value 0 and type size_t), so the expression can be used
+ e.g. in a structure initializer (or where-ever else comma expressions
+ aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+/* &a[0] degrades to a pointer: a different type from an array */
+#define __must_be_array(a) \
+ BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#define _countof(arr) ARRAY_SIZE(arr)
+
+int _stprintf_s(
+ TCHAR*buffer,
+ size_t sizeOfBuffer,
+ const TCHAR *format ,
+ ...
+ )
+{
+ int ret;
+ va_list args;
+
+ va_start (args, format);
+ ret = _vstprintf( buffer, format, args);
+ va_end(args);
+ return ret;
+}
+
+double _wtof( const wchar_t *string )
+{
+ double ret;
+ size_t len = wcslen(string) + 1;
+ char* p = (char*) malloc(len);
+
+ wcstombs(p,string,len);
+ ret = atof(p);
+ free(p);
+ return ret;
+}
+
+#endif
+
typedef struct mswin_nethack_main_window {
int mapAcsiiModeSave;
} NHMainWindow, *PNHMainWindow;
#include "mhmain.h"
#include "mhmap.h"
-#ifndef __BORLANDC__
-#include <shlwapi.h>
-#else /* Borland redefines "boolean" in shlwapi.h so just use the little bit we need */
+/* Borland and MinGW redefine "boolean" in shlwapi.h,
+ so just use the little bit we need */
typedef struct _DLLVERSIONINFO
{
DWORD cbSize;
typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
-#endif
+/* en of shlwapi.h */
/* Minimal common control library version
Version _WIN_32IE Platform/IE