enable compiling wide char with MINGW

This commit is contained in:
Holger Vogt 2020-03-06 14:53:27 +01:00
parent 7a7f717574
commit 8d9d40d621
3 changed files with 7 additions and 6 deletions

View File

@ -56,14 +56,14 @@ if test "$1" = "32"; then
echo "configuring for 32 bit"
echo
# You may add --enable-adms to the following command for adding adms generated devices
../configure --with-wingui --enable-xspice --enable-cider --enable-openmp --disable-debug --disable-utf8 prefix="C:/Spice" CFLAGS="-m32 -O2" LDFLAGS="-m32 -s"
../configure --with-wingui --enable-xspice --enable-cider --enable-openmp --disable-debug prefix="C:/Spice" CFLAGS="-m32 -O2" LDFLAGS="-m32 -s"
else
cd release
if [ $? -ne 0 ]; then echo "cd release failed"; exit 1 ; fi
echo "configuring for 64 bit"
echo
# You may add --enable-adms to the following command for adding adms generated devices
../configure --with-wingui --enable-xspice --enable-cider --enable-openmp --disable-debug --disable-utf8 prefix="C:/Spice64" CFLAGS="-m64 -O2" LDFLAGS="-m64 -s"
../configure --with-wingui --enable-xspice --enable-cider --enable-openmp --disable-debug prefix="C:/Spice64" CFLAGS="-m64 -O2" LDFLAGS="-m64 -s"
fi
if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi

View File

@ -111,6 +111,7 @@ ngspice_SOURCES = \
ngspice_CPPFLAGS = $(AM_CPPFLAGS) -DSIMULATOR
if WINGUI
ngspice_LDFLAGS = -municode $(AM_LDFLAGS)
ngspice_SOURCES += winmain.c hist_info.c
endif

View File

@ -31,8 +31,8 @@
#include <ctype.h>
#include <sys/types.h>
#include <sys/timeb.h>
#ifndef _MSC_VER
#include <wchar.h>
#ifdef __MINGW32__
#include <tchar.h>
#include <stdio.h>
#endif
@ -970,7 +970,7 @@ MakeArgcArgv(char *cmdline, int *argc, char ***argv)
int WINAPI
WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpszCmdLine, _In_ int nCmdShow)
#else
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__MINGW32__)
int WINAPI
wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR wlpszCmdLine, _In_ int nCmdShow)
#else
@ -998,7 +998,7 @@ WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR n
#ifndef EXT_ASC
/* convert wchar to utf-8 */
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__MINGW32__)
char lpszCmdLine[1024];
WideCharToMultiByte(CP_UTF8, 0, wlpszCmdLine, -1, lpszCmdLine, 1023, NULL, FALSE);
#else