diff --git a/.gitignore b/.gitignore index 65ece6ae..25ba6526 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ janet /Emscripten /src/include/generated/*.h janet-*.tar.gz +dist # Emscripten *.bc diff --git a/Makefile b/Makefile index 29a45d83..d50ddc9e 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ dist: build/janet-dist.tar.gz build/janet-%.tar.gz: $(JANET_TARGET) src/include/janet/janet.h \ janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) \ - build/doc.html README.md $(wildcard doc/*) + build/doc.html README.md $(wildcard doc/*.md) tar -czvf $@ $^ ######################### diff --git a/appveyor.yml b/appveyor.yml index c8243a46..c9055a52 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,10 @@ init: install: - build_win - build_win test + - choco install nsis -y -pre + - call "C:\Program Files (x86)\NSIS\makensis.exe" janet-installer.nsi - build_win dist + - copy janet-install.exe dist\install.exe build: off diff --git a/build_win.bat b/build_win.bat index a5f6483f..1169d393 100644 --- a/build_win.bat +++ b/build_win.bat @@ -100,7 +100,6 @@ copy README.md dist\README.md copy janet.lib dist\janet.lib copy janet.exp dist\janet.exp copy src\include\janet\janet.h dist\janet.h -xcopy /s doc dist\doc exit /b 0 :TESTFAIL diff --git a/janet-installer.nsi b/janet-installer.nsi new file mode 100644 index 00000000..94a8e2f7 --- /dev/null +++ b/janet-installer.nsi @@ -0,0 +1,55 @@ +!define MULTIUSER_EXECUTIONLEVEL Highest +!define MULTIUSER_MUI +!define MULTIUSER_INSTALLMODE_COMMANDLINE +!define MULTIUSER_INSTALLMODE_INSTDIR "janet" +!include "MultiUser.nsh" +!include "MUI2.nsh" + +Name "Janet" +OutFile "janet-install.exe" + +!define MUI_ABORTWARNING + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE" +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MULTIUSER_PAGE_INSTALLMODE +!insertmacro MUI_PAGE_DIRECTORY + +!insertmacro MUI_PAGE_INSTFILES + +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +!insertmacro MUI_LANGUAGE "English" + +Section "Janet" BfWSection + SetOutPath $INSTDIR + File "janet.exe" + WriteUninstaller "$INSTDIR\janet-uninstall.exe" + + # Start Menu + CreateShortCut "$SMPROGRAMS\Janet.lnk" "$INSTDIR\janet.exe" "" "" +SectionEnd + +Function .onInit + !insertmacro MULTIUSER_INIT + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${BfWSection} "The Janet programming language." +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +Section "Uninstall" + Delete "$INSTDIR\janet.exe" + Delete "$INSTDIR\janet-uninstall.exe" + RMDir "$INSTDIR" +SectionEnd + +Function un.onInit + !insertmacro MULTIUSER_UNINIT + !insertmacro MUI_UNGETLANGUAGE +FunctionEnd \ No newline at end of file diff --git a/src/include/janet/janet.h b/src/include/janet/janet.h index f3a6cddd..5e5e74df 100644 --- a/src/include/janet/janet.h +++ b/src/include/janet/janet.h @@ -1158,8 +1158,8 @@ JANET_API int janet_typeabstract_err(JanetArgs args, int32_t n, const JanetAbstr } while (0) #define JANET_CHECKMANY(A, N, TS) do {\ if ((A).n > (N)) {\ - JanetType t = janet_type((A).v[(N)]);\ - if (!((1 << t) & (TS))) return janet_typemany_err(A, N, TS);\ + JanetType _t_ = janet_type((A).v[(N)]);\ + if (!((1 << _t_) & (TS))) return janet_typemany_err(A, N, TS);\ } else {\ if (!((TS) & JANET_NIL)) return janet_typemany_err(A, N, TS);\ }\ @@ -1167,9 +1167,9 @@ JANET_API int janet_typeabstract_err(JanetArgs args, int32_t n, const JanetAbstr #define JANET_CHECKABSTRACT(A, N, AT) do {\ if ((A).n > (N)) {\ - Janet x = (A).v[(N)];\ - if (!janet_checktype(x, JANET_ABSTRACT) ||\ - janet_abstract_type(janet_unwrap_abstract(x)) != (AT))\ + Janet _x_ = (A).v[(N)];\ + if (!janet_checktype(_x_, JANET_ABSTRACT) ||\ + janet_abstract_type(janet_unwrap_abstract(_x_)) != (AT))\ return janet_typeabstract_err(A, N, AT);\ } else {\ return janet_typeabstract_err(A, N, AT);\ @@ -1177,15 +1177,16 @@ JANET_API int janet_typeabstract_err(JanetArgs args, int32_t n, const JanetAbstr } while (0) #define JANET_ARG_NUMBER(DEST, A, N) do { \ - if ((A).n <= (N)) \ - return janet_typemany_err(A, N, JANET_TFLAG_NUMBER);\ - Janet val = (A).v[(N)];\ - if (janet_checktype(val, JANET_REAL)) { \ - DEST = janet_unwrap_real(val); \ - } else if (janet_checktype(val, JANET_INTEGER)) {\ - DEST = (double) janet_unwrap_integer(val);\ - }\ - else return janet_typemany_err(A, N, JANET_TFLAG_NUMBER); \ + if ((A).n <= (N)) return janet_typemany_err(A, N, JANET_TFLAG_NUMBER); \ + Janet _val_ = (A).v[(N)];\ + JanetType _type_ = janet_type(_val_); \ + if (_type_ == JANET_REAL) { \ + DEST = janet_unwrap_real(_val_); \ + } else if (_type_ == JANET_INTEGER) {\ + DEST = (double) janet_unwrap_integer(_val_);\ + } else { \ + return janet_typemany_err(A, N, JANET_TFLAG_NUMBER); \ + } \ } while (0) #define JANET_ARG_BOOLEAN(DEST, A, N) do { \