diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 4398036e3a..eee43d50de 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -55,6 +55,8 @@ #pragma warning (disable : 4355) /* C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data */ #pragma warning (disable : 4244) +/* C4577: 'noexcept' used with no exception handling mode specified */ +#pragma warning (disable : 4577) #if _MSC_VER >= 1300 #if _MSC_VER >= 1310 diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index a49d5b1477..abcf7ad3f5 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -166,6 +166,14 @@ typedef ios::seekdir ios_seekdir; # define FINAL final # define OVERRIDE override # define MOVE(x) move(x) +#elif defined(_MSC_VER) && _MSC_VER >= 1900 +// MSVC 2015 supports all of this goodness. +# define CONSTEXPR constexpr +# define NOEXCEPT noexcept +# define USE_MOVE_SEMANTICS +# define FINAL final +# define OVERRIDE override +# define MOVE(x) move(x) #elif defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC 2010 has move semantics. Not much else. # define CONSTEXPR INLINE diff --git a/dtool/src/dtoolbase/stl_compares.I b/dtool/src/dtoolbase/stl_compares.I index 31ac164cad..e0d51b74dd 100644 --- a/dtool/src/dtoolbase/stl_compares.I +++ b/dtool/src/dtoolbase/stl_compares.I @@ -132,7 +132,11 @@ add_hash(size_t hash, const Key &key) { INLINE size_t pointer_hash:: add_hash(size_t hash, const void *key) { // We don't mind if this loses precision. +#ifdef _MSC_VER + PN_uint32 key32 = PtrToUlong(key); +#else PN_uint32 key32 = (PN_uint32)reinterpret_cast(key); +#endif return AddHash::add_hash(hash, &key32, 1); } diff --git a/dtool/src/dtoolutil/lineStream.h b/dtool/src/dtoolutil/lineStream.h index 63358a18ac..fe0e271933 100644 --- a/dtool/src/dtoolutil/lineStream.h +++ b/dtool/src/dtoolutil/lineStream.h @@ -37,6 +37,10 @@ class EXPCL_DTOOL LineStream : public ostream { PUBLISHED: INLINE LineStream(); +#if _MSC_VER >= 1800 + INLINE LineStream(const LineStream ©) = delete; +#endif + INLINE bool is_text_available() const; INLINE string get_line(); INLINE bool has_newline() const; diff --git a/dtool/src/dtoolutil/pfstream.h b/dtool/src/dtoolutil/pfstream.h index d9875f9090..fb6d29f0aa 100644 --- a/dtool/src/dtoolutil/pfstream.h +++ b/dtool/src/dtoolutil/pfstream.h @@ -21,6 +21,10 @@ class EXPCL_DTOOL IPipeStream : public istream { PUBLISHED: INLINE IPipeStream(const std::string); +#if _MSC_VER >= 1800 + INLINE IPipeStream(const IPipeStream ©) = delete; +#endif + INLINE void flush(); private: @@ -33,6 +37,10 @@ class EXPCL_DTOOL OPipeStream : public ostream { PUBLISHED: INLINE OPipeStream(const std::string); +#if _MSC_VER >= 1800 + INLINE OPipeStream(const OPipeStream ©) = delete; +#endif + INLINE void flush(); private: diff --git a/dtool/src/prc/encryptStream.h b/dtool/src/prc/encryptStream.h index bca9c8dc4d..75787d26e8 100644 --- a/dtool/src/prc/encryptStream.h +++ b/dtool/src/prc/encryptStream.h @@ -40,6 +40,10 @@ PUBLISHED: INLINE IDecryptStream(istream *source, bool owns_source, const string &password); +#if _MSC_VER >= 1800 + INLINE IDecryptStream(const IDecryptStream ©) = delete; +#endif + INLINE IDecryptStream &open(istream *source, bool owns_source, const string &password); INLINE IDecryptStream &close(); @@ -69,6 +73,10 @@ PUBLISHED: INLINE OEncryptStream(ostream *dest, bool owns_dest, const string &password); +#if _MSC_VER >= 1800 + INLINE OEncryptStream(const OEncryptStream ©) = delete; +#endif + INLINE OEncryptStream &open(ostream *dest, bool owns_dest, const string &password); INLINE OEncryptStream &close(); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b536140238..77712197de 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -64,9 +64,10 @@ PLUGIN_VERSION=None OSXTARGET=None OSX_ARCHS=[] HOST_URL=None -global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER +global STRDXSDKVERSION, BOOUSEINTELCOMPILER STRDXSDKVERSION = 'default' -STRMSPLATFORMVERSION = 'default' +WINDOWS_SDK = None +MSVC_VERSION = None BOOUSEINTELCOMPILER = False OPENCV_VER_23 = False @@ -152,7 +153,8 @@ def usage(problem): print(" --nothing (disable every third-party lib)") print(" --everything (enable every third-party lib)") print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)") - print(" --platform-sdk=X (specify MSPlatSdk to use: win71, win61, win60A, winserver2003r2)") + print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)") + print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)") print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") print("") print("The simplest way to compile panda is to just type:") @@ -165,13 +167,13 @@ def parseopts(args): global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX - global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER + global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER longopts = [ "help","distributor=","verbose","runtime","osxtarget=", "optimize=","everything","nothing","installer","rtdist","nocolor", "version=","lzma","no-python","threads=","outputdir=","override=", "static","host=","debversion=","rpmrelease=","p3dsuffix=", - "directx-sdk=", "platform-sdk=", "use-icl", + "directx-sdk=", "windows-sdk=", "msvc-version=", "use-icl", "universal", "target=", "arch=", "git-commit="] anything = 0 optimize = "" @@ -222,11 +224,10 @@ def parseopts(args): if STRDXSDKVERSION == '': print("No DirectX SDK version specified. Using 'default' DirectX SDK search") STRDXSDKVERSION = 'default' - elif (option=="--platform-sdk"): - STRMSPLATFORMVERSION = value.strip().lower() - if STRMSPLATFORMVERSION == '': - print("No MS Platform SDK version specified. Using 'default' MS Platform SDK search") - STRMSPLATFORMVERSION = 'default' + elif (option=="--windows-sdk"): + WINDOWS_SDK = value.strip().lower() + elif (option=="--msvc-version"): + MSVC_VERSION = value.strip().lower() elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True else: for pkg in PkgListGet(): @@ -302,17 +303,30 @@ def parseopts(args): if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT): usage("Invalid SHA-1 hash given for --git-commit option!") - is_win7 = False - if GetHost() == "windows": - if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']): - platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder") + if GetTarget() == 'windows': + if not MSVC_VERSION: + print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).") + MSVC_VERSION = 10 - if sys.platform == "win32": - # Note: not available in cygwin. - winver = sys.getwindowsversion() - if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1: - is_win7 = True - if RUNTIME or not is_win7: + try: + MSVC_VERSION = int(MSVC_VERSION) + except: + usage("Invalid setting for --msvc-version") + + if not WINDOWS_SDK: + print("No Windows SDK version specified. Defaulting to '7.1'.") + WINDOWS_SDK = '7.1' + + is_win7 = False + if sys.platform == 'win32': + # Note: not available in cygwin. + winver = sys.getwindowsversion() + if winver[0] >= 6 and winver[1] >= 1: + is_win7 = True + + if RUNTIME or not is_win7: + PkgDisable("TOUCHINPUT") + else: PkgDisable("TOUCHINPUT") parseopts(sys.argv[1:]) @@ -444,8 +458,8 @@ SdkLocateMaya() SdkLocateMax() SdkLocateMacOSX(OSXTARGET) SdkLocatePython(RTDIST) -SdkLocateVisualStudio() -SdkLocateMSPlatform(STRMSPLATFORMVERSION) +SdkLocateVisualStudio(MSVC_VERSION) +SdkLocateWindows(WINDOWS_SDK) SdkLocatePhysX() SdkLocateSpeedTree() SdkLocateAndroid() @@ -1050,6 +1064,10 @@ def CompileCxx(obj,src,opts): if GetTargetArch() == 'x64': cmd += " /DWIN64_VC /DWIN64" + if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10: + # To preserve Windows XP compatibility. + cmd += " /D_USING_V110_SDK71_" + cmd += " /W3 " + BracketNameWithQuotes(src) oscmd(cmd) else: @@ -1485,9 +1503,13 @@ def CompileLink(dll, obj, opts): cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO " cmd += ' /OUT:' + BracketNameWithQuotes(dll) - subsystem = GetValueOption(opts, "SUBSYSTEM:") - if subsystem: - cmd += " /SUBSYSTEM:" + subsystem + # Set the subsystem. Specify that we want to target Windows XP. + subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE" + cmd += " /SUBSYSTEM:" + subsystem + if GetTargetArch() == 'x64': + cmd += ",5.02" + else: + cmd += ",5.01" if dll.endswith(".dll"): cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib" @@ -5096,7 +5118,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj') - OPTS=['OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] + OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] TargetAdd('p3dcert.exe', opts=OPTS) @@ -5106,7 +5128,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj') TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') - OPTS=['OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG'] + OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG'] if GetTarget() == "darwin": OPTS += ['GL', 'OPT:2'] TargetAdd('p3dcert.exe', opts=OPTS) @@ -5236,7 +5258,7 @@ if (RUNTIME): TargetAdd('panda3dw.exe', input='libp3dtool.dll') TargetAdd('panda3dw.exe', input='libp3pystub.lib') TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb') - TargetAdd('panda3dw.exe', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) + TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) if (RTDIST): OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB'] @@ -5312,7 +5334,7 @@ if (RTDIST): TargetAdd('p3dembedw.exe', input='plugin_common.obj') TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb') TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb') - TargetAdd('p3dembedw.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL']) + TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL']) # # DIRECTORY: pandatool/src/pandatoolbase/ @@ -6041,7 +6063,7 @@ if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0) TargetAdd('pstats.exe', input='libp3pandatoolbase.lib') TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS) TargetAdd('pstats.exe', input='libp3pystub.lib') - TargetAdd('pstats.exe', opts=['WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) + TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) # # DIRECTORY: pandatool/src/xfileprogs/ diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index c9639ab1c7..7d921ee9d2 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -531,10 +531,12 @@ def oscmd(cmd, ignoreError = False): if res != 0 and not ignoreError: if "interrogate" in cmd.split(" ", 1)[0] and GetVerbose(): print(ColorText("red", "Interrogate failed, retrieving debug output...")) + sys.stdout.flush() + verbose_cmd = cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1] if sys.platform == "win32": - os.spawnl(os.P_WAIT, exe, cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1]) + os.spawnl(os.P_WAIT, exe_path, verbose_cmd) else: - os.system(cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1]) + os.system(verbose_cmd) exit("The following command returned a non-zero value: " + str(cmd)) return res @@ -1946,18 +1948,21 @@ def SdkLocatePython(prefer_thirdparty_python=False): else: print("Using Python %s" % (SDK["PYTHONVERSION"][6:9])) -def SdkLocateVisualStudio(): +def SdkLocateVisualStudio(version=10): if (GetHost() != "windows"): return - vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "10.0") + + version = str(version) + '.0' + + vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", version) if (vcdir != 0) and (vcdir[-4:] == "\\VC\\"): vcdir = vcdir[:-3] SDK["VISUALSTUDIO"] = vcdir - elif (os.path.isfile("C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")): - SDK["VISUALSTUDIO"] = "C:\\Program Files\\Microsoft Visual Studio 10.0\\" + elif (os.path.isfile("C:\\Program Files\\Microsoft Visual Studio %s\\VC\\bin\\cl.exe" % (version))): + SDK["VISUALSTUDIO"] = "C:\\Program Files\\Microsoft Visual Studio %s\\" % (version) - elif (os.path.isfile("C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")): - SDK["VISUALSTUDIO"] = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\" + elif (os.path.isfile("C:\\Program Files (x86)\\Microsoft Visual Studio %s\\VC\\bin\\cl.exe")): + SDK["VISUALSTUDIO"] = "C:\\Program Files (x86)\\Microsoft Visual Studio %s\\" % (version) elif "VCINSTALLDIR" in os.environ: vcdir = os.environ["VCINSTALLDIR"] @@ -1968,26 +1973,49 @@ def SdkLocateVisualStudio(): SDK["VISUALSTUDIO"] = vcdir -def SdkLocateMSPlatform(strMode = 'default'): + else: + exit("Couldn't find Visual Studio %s. To use a different version, use the --msvc-version option." % version) + + SDK["VISUALSTUDIO_VERSION"] = version + + if GetVerbose(): + print("Using Visual Studio %s located at %s" % (version, SDK["VISUALSTUDIO"])) + else: + print("Using Visual Studio %s" % (version)) + +def SdkLocateWindows(version = '7.1'): if (GetHost() != "windows"): return - platsdk = None - platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder") - if (platsdk and not os.path.isdir(platsdk)): - platsdk = None + version = version.upper() - if not platsdk: - # Most common location. Worth a try. - platsdk = "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1" - if not os.path.isdir(platsdk): - platsdk = None + if version == '10': + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + elif version == '8.0': + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") + else: + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder") - if not platsdk: - exit("Couldn't find Windows SDK v7.1") + if not platsdk or not os.path.isdir(platsdk): + # Most common location. Worth a try. + platsdk = GetProgramFiles() + "\\Microsoft SDKs\\Windows\\v" + version + if not os.path.isdir(platsdk): + if not version.endswith('A'): + # Try the stripped-down version that is bundled with Visual Studio. + return SdkLocateWindows(version + 'A') + platsdk = None + + if not platsdk or not os.path.isdir(platsdk): + exit("Couldn't find Windows SDK version %s. To use a different version, use the --windows-sdk option." % (version)) if not platsdk.endswith("\\"): platsdk += "\\" SDK["MSPLATFORM"] = platsdk + SDK["MSPLATFORM_VERSION"] = version + + if GetVerbose(): + print("Using Windows SDK %s located at %s" % (version, platsdk)) + else: + print("Using Windows SDK %s" % (version)) def SdkLocateMacOSX(osxtarget = None): if (GetHost() != "darwin"): return @@ -2225,20 +2253,44 @@ def SetupVisualStudioEnviron(): AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include") AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib\\" + libdir) AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib\\" + libdir) - AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc") - if (arch != 'x64'): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib") - AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT") - AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC") - elif (os.path.isdir(SDK["MSPLATFORM"] + "lib\\x64")): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\x64") - elif (os.path.isdir(SDK["MSPLATFORM"] + "lib\\amd64")): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\amd64") + + if SDK["MSPLATFORM_VERSION"] == '10': + AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin\\" + arch) + + # Windows Kit 10 introduces the "universal CRT". + inc_dir = SDK["MSPLATFORM"] + "Include\\10.0.10240.0\\" + lib_dir = SDK["MSPLATFORM"] + "Lib\\10.0.10240.0\\" + AddToPathEnv("INCLUDE", inc_dir + "shared") + AddToPathEnv("INCLUDE", inc_dir + "ucrt") + AddToPathEnv("INCLUDE", inc_dir + "um") + AddToPathEnv("LIB", lib_dir + "ucrt\\" + arch) + AddToPathEnv("LIB", lib_dir + "um\\" + arch) else: - exit("Could not locate 64-bits libraries in Platform SDK!") + AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc") + + if arch != 'x64': + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib") + AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT") + AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC") + + elif os.path.isdir(SDK["MSPLATFORM"] + "lib\\x64"): + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\x64") + + elif os.path.isdir(SDK["MSPLATFORM"] + "lib\\amd64"): + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\amd64") + + else: + exit("Could not locate 64-bits libraries in Windows SDK directory!\nUsing directory: %s" % SDK["MSPLATFORM"]) + + # Targeting the 7.1 SDK (which is the only way to have Windows XP support) + # with Visual Studio 2015 requires use of the Universal CRT. + if SDK["MSPLATFORM_VERSION"] == '7.1' and SDK["VISUALSTUDIO_VERSION"] == '14.0': + win_kit = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + AddToPathEnv("LIB", win_kit + "Lib\\10.0.10150.0\\ucrt\\" + arch) + AddToPathEnv("INCLUDE", win_kit + "Include\\10.0.10150.0\\ucrt") ######################################################################## # diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index ea143e0bfa..726306e8ae 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -223,14 +223,17 @@ HTTPDate(const string &format) { if (_time != (time_t)-1) { // Unfortunately, mktime() assumes local time; convert this back // to GMT. -#ifdef IS_FREEBSD +#if defined(IS_FREEBSD) time_t now = time(NULL); struct tm *tp = localtime(&now); _time -= tp->tm_gmtoff; -#else /* IS_FREEBSD */ +#elif defined(_WIN32) + extern long int _timezone; + _time -= _timezone; +#else extern long int timezone; _time -= timezone; -#endif /* IS_FREEBSD */ +#endif } #endif // __GNUC__ } diff --git a/panda/src/downloader/multiplexStream.h b/panda/src/downloader/multiplexStream.h index 1b4a5e8fc5..a82ed96233 100644 --- a/panda/src/downloader/multiplexStream.h +++ b/panda/src/downloader/multiplexStream.h @@ -36,6 +36,10 @@ class EXPCL_PANDAEXPRESS MultiplexStream : public ostream { PUBLISHED: INLINE MultiplexStream(); +#if _MSC_VER >= 1800 + INLINE MultiplexStream(const MultiplexStream ©) = delete; +#endif + INLINE void add_ostream(ostream *out, bool delete_later = false); INLINE bool add_stdio_file(FILE *file, bool close_when_done); INLINE void add_standard_output(); diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index 158f6194ca..6970887a25 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -35,6 +35,10 @@ PUBLISHED: EXTENSION(StringStream(PyObject *source)); INLINE StringStream(); +#if _MSC_VER >= 1800 + INLINE StringStream(const StringStream ©) = delete; +#endif + INLINE void clear_data(); INLINE size_t get_data_size(); diff --git a/panda/src/express/checksumHashGenerator.I b/panda/src/express/checksumHashGenerator.I index 63f31897c5..2a094eda4c 100644 --- a/panda/src/express/checksumHashGenerator.I +++ b/panda/src/express/checksumHashGenerator.I @@ -68,5 +68,9 @@ add_fp(double number, double threshold) { //////////////////////////////////////////////////////////////////// INLINE void ChecksumHashGenerator:: add_pointer(void *ptr) { +#ifdef _WIN32 + add_int(PtrToLong(ptr)); +#else add_int((long)ptr); +#endif } diff --git a/panda/src/express/subStream.h b/panda/src/express/subStream.h index 71171f350a..7dbfab475f 100644 --- a/panda/src/express/subStream.h +++ b/panda/src/express/subStream.h @@ -36,6 +36,10 @@ PUBLISHED: INLINE ISubStream(); INLINE ISubStream(IStreamWrapper *source, streampos start, streampos end); +#if _MSC_VER >= 1800 + INLINE ISubStream(const ISubStream ©) = delete; +#endif + INLINE ISubStream &open(IStreamWrapper *source, streampos start, streampos end); INLINE ISubStream &close(); @@ -60,6 +64,10 @@ PUBLISHED: INLINE OSubStream(); INLINE OSubStream(OStreamWrapper *dest, streampos start, streampos end, bool append = false); +#if _MSC_VER >= 1800 + INLINE OSubStream(const OSubStream ©) = delete; +#endif + INLINE OSubStream &open(OStreamWrapper *dest, streampos start, streampos end, bool append = false); INLINE OSubStream &close(); @@ -77,6 +85,10 @@ PUBLISHED: INLINE SubStream(); INLINE SubStream(StreamWrapper *nested, streampos start, streampos end, bool append = false); +#if _MSC_VER >= 1800 + INLINE SubStream(const SubStream ©) = delete; +#endif + INLINE SubStream &open(StreamWrapper *nested, streampos start, streampos end, bool append = false); INLINE SubStream &close(); diff --git a/panda/src/express/zStream.h b/panda/src/express/zStream.h index 1df8aa6416..1f4289bc2a 100644 --- a/panda/src/express/zStream.h +++ b/panda/src/express/zStream.h @@ -39,6 +39,10 @@ PUBLISHED: INLINE IDecompressStream(); INLINE IDecompressStream(istream *source, bool owns_source); +#if _MSC_VER >= 1800 + INLINE IDecompressStream(const IDecompressStream ©) = delete; +#endif + INLINE IDecompressStream &open(istream *source, bool owns_source); INLINE IDecompressStream &close(); @@ -61,10 +65,14 @@ private: class EXPCL_PANDAEXPRESS OCompressStream : public ostream { PUBLISHED: INLINE OCompressStream(); - INLINE OCompressStream(ostream *dest, bool owns_dest, + INLINE OCompressStream(ostream *dest, bool owns_dest, int compression_level = 6); - INLINE OCompressStream &open(ostream *dest, bool owns_dest, +#if _MSC_VER >= 1800 + INLINE OCompressStream(const OCompressStream ©) = delete; +#endif + + INLINE OCompressStream &open(ostream *dest, bool owns_dest, int compression_level = 6); INLINE OCompressStream &close();