From a251c6dd8fcd2770e9f0bcc694a70dbac594668f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 27 May 2018 13:51:48 -0600 Subject: [PATCH] general: Change HAVE_LOCKF to PHAVE_LOCKF HAVE_LOCKF is already defined by pyconfig.h in (at least) Python 3.6 - changing the macro name here avoids warnings --- dtool/src/dtoolutil/filename.cxx | 6 +++--- makepanda/makepanda.py | 4 ++-- panda/src/gobj/vertexDataSaveFile.cxx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index d2c566b557..42bdf12e2f 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -48,7 +48,7 @@ #include #endif -#if defined(__ANDROID__) && !defined(HAVE_LOCKF) +#if defined(__ANDROID__) && !defined(PHAVE_LOCKF) // Needed for flock. #include #endif @@ -2752,7 +2752,7 @@ atomic_compare_and_exchange_contents(string &orig_contents, orig_contents = string(); -#ifdef HAVE_LOCKF +#ifdef PHAVE_LOCKF if (lockf(fd, F_LOCK, 0) != 0) { #else if (flock(fd, LOCK_EX) != 0) { @@ -2868,7 +2868,7 @@ atomic_read_contents(string &contents) const { contents = string(); -#ifdef HAVE_LOCKF +#ifdef PHAVE_LOCKF if (lockf(fd, F_LOCK, 0) != 0) { #else if (flock(fd, LOCK_EX) != 0) { diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index fdfd682ff4..a810da13af 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2268,7 +2268,7 @@ DTOOL_CONFIG=[ ("DEFAULT_PATHSEP", '";"', '":"'), ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'), ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'), - ("HAVE_LOCKF", '1', '1'), + ("PHAVE_LOCKF", '1', '1'), ("HAVE_WCHAR_T", '1', '1'), ("HAVE_WSTRING", '1', '1'), ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'), @@ -2445,7 +2445,7 @@ def WriteConfigSettings(): # Android does have RTTI, but we disable it anyway. dtool_config["HAVE_RTTI"] = 'UNDEF' dtool_config["PHAVE_GLOB_H"] = 'UNDEF' - dtool_config["HAVE_LOCKF"] = 'UNDEF' + dtool_config["PHAVE_LOCKF"] = 'UNDEF' dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF' if (GetOptimize() <= 2 and GetTarget() == "windows"): diff --git a/panda/src/gobj/vertexDataSaveFile.cxx b/panda/src/gobj/vertexDataSaveFile.cxx index fd7087ba5d..e602b51129 100644 --- a/panda/src/gobj/vertexDataSaveFile.cxx +++ b/panda/src/gobj/vertexDataSaveFile.cxx @@ -23,7 +23,7 @@ #include #endif // _WIN32 -#if defined(__ANDROID__) && !defined(HAVE_LOCKF) +#if defined(__ANDROID__) && !defined(PHAVE_LOCKF) // Needed for flock. #include #endif @@ -130,7 +130,7 @@ VertexDataSaveFile(const Filename &directory, const string &prefix, // Now try to lock the file, so we can be sure that no other process is // simultaneously writing to the same save file. -#ifdef HAVE_LOCKF +#ifdef PHAVE_LOCKF int result = lockf(_fd, F_TLOCK, 0); #else int result = flock(_fd, LOCK_EX | LOCK_NB);