diff --git a/contrib/liblzma/compress_easy_mt.cpp b/contrib/liblzma/compress_easy_mt.cpp index 092450e..2ba1da2 100644 --- a/contrib/liblzma/compress_easy_mt.cpp +++ b/contrib/liblzma/compress_easy_mt.cpp @@ -38,7 +38,7 @@ bool check(lzma_ret ret) { return false; } -#if _WIN64 || __amd64__ +#ifdef BIT64 const uint32_t dict = 4; #else const uint32_t dict = 2; diff --git a/make.bat b/make.bat index b0ee4fa..e0bd692 100644 --- a/make.bat +++ b/make.bat @@ -17,6 +17,7 @@ set GPP64=g++ set EXE1=precomp set EXE2= set DCOMFORT= +set DBIT= set MPARAM=-march=pentiumpro set GCC=%GCC32% set GPP=%GPP32% @@ -27,6 +28,7 @@ if "%1%"=="64" ( set GCC=%GCC64% set GPP=%GPP64% set EXE2=64 + set DBIT=-DBIT64 set MPARAM=-march=x86-64 -m64 ) if "%1%"=="comfort" ( @@ -114,7 +116,7 @@ move /Y *.o ..\..\ > nul popd :nocontrib echo Building precomp... -%GPP% %DCOMFORT% %MPARAM% -static -static-libgcc -static-libstdc++ -DMINGW -lpthread -Wall precomp.cpp %JPG_O% %MP3_O% %GIF_O% %BZIP_O% %ZLIB_O% %LIBLZMA_CPP% %LIBLZMA_O% -O2 -fomit-frame-pointer -s -o%EXE1%%EXE2%.exe +%GPP% %DCOMFORT% %MPARAM% -static -static-libgcc -static-libstdc++ -DMINGW %DBIT% -lpthread -Wall precomp.cpp %JPG_O% %MP3_O% %GIF_O% %BZIP_O% %ZLIB_O% %LIBLZMA_CPP% %LIBLZMA_O% -O2 -fomit-frame-pointer -s -o%EXE1%%EXE2%.exe if not %ERRORLEVEL% == 0 echo ERROR!!! if %ERRORLEVEL% == 0 echo. if %ERRORLEVEL% == 0 echo Build successful. diff --git a/precomp.cpp b/precomp.cpp index 4aff0f1..707c250 100644 --- a/precomp.cpp +++ b/precomp.cpp @@ -24,6 +24,16 @@ #define V_STATE "DEVELOPMENT" //#define V_MSG "USE FOR TESTING ONLY" #define V_MSG "USE AT YOUR OWN RISK!" +#ifdef UNIX + #define V_OS "Unix" +#else + #define V_OS "Windows" +#endif +#ifdef BIT64 + #define V_BIT "64-bit" +#else + #define V_BIT "32-bit" +#endif // batch error levels #define RETURN_NOTHING_DECOMPRESSED 2 @@ -479,9 +489,9 @@ int init(int argc, char* argv[]) { printf("\n"); if (V_MINOR2 == 0) { - printf("Precomp v%i.%i - %s version",V_MAJOR,V_MINOR,V_STATE); + printf("Precomp v%i.%i %s %s - %s version",V_MAJOR,V_MINOR,V_OS,V_BIT,V_STATE); } else { - printf("Precomp v%i.%i.%i - %s version",V_MAJOR,V_MINOR,V_MINOR2,V_STATE); + printf("Precomp v%i.%i.%i %s %s - %s version",V_MAJOR,V_MINOR,V_MINOR2,V_OS,V_BIT,V_STATE); } printf(" - %s\n",V_MSG); printf("Free for non-commercial use - Copyright 2006-2016 by Christian Schneider\n\n"); @@ -1098,9 +1108,9 @@ int init_comfort(int argc, char* argv[]) { printf("\n"); if (V_MINOR2 == 0) { - printf("Precomp Comfort v%i.%i - %s version",V_MAJOR,V_MINOR,V_STATE); + printf("Precomp Comfort v%i.%i %s %s - %s version",V_MAJOR,V_MINOR,V_OS,V_BIT,V_STATE); } else { - printf("Precomp Comfort v%i.%i.%i - %s version",V_MAJOR,V_MINOR,V_MINOR2,V_STATE); + printf("Precomp Comfort v%i.%i.%i %s %s - %s version",V_MAJOR,V_MINOR,V_MINOR2,V_OS,V_BIT,V_STATE); } printf(" - %s\n",V_MSG); printf("Free for non-commercial use - Copyright 2006-2016 by Christian Schneider\n\n"); @@ -1180,7 +1190,7 @@ int init_comfort(int argc, char* argv[]) { exit(1); } else { FILE* fnewini = fopen(precomf_ini,"w"); - fprintf(fnewini,";; Precomp Comfort v%i.%i.%i - %s version - INI file\n",V_MAJOR,V_MINOR,V_MINOR2,V_STATE); + fprintf(fnewini,";; Precomp Comfort v%i.%i.%i %s %s - %s version - INI file\n",V_MAJOR,V_MINOR,V_MINOR2,V_OS,V_BIT,V_STATE); fprintf(fnewini,";; Use a semicolon (;) for comments\n\n"); fprintf(fnewini,";; Compression method to use\n"); fprintf(fnewini,";; 0 = none, 1 = bZip2, 2 = lzma, 3 = xz(lzma2), 4 = xz Multi-Threaded\n");