ソースを参照

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
Sam Edwards 7 年 前
コミット
a251c6dd8f

+ 3 - 3
dtool/src/dtoolutil/filename.cxx

@@ -48,7 +48,7 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
-#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
+#if defined(__ANDROID__) && !defined(PHAVE_LOCKF)
 // Needed for flock.
 // Needed for flock.
 #include <sys/file.h>
 #include <sys/file.h>
 #endif
 #endif
@@ -2752,7 +2752,7 @@ atomic_compare_and_exchange_contents(string &orig_contents,
 
 
   orig_contents = string();
   orig_contents = string();
 
 
-#ifdef HAVE_LOCKF
+#ifdef PHAVE_LOCKF
   if (lockf(fd, F_LOCK, 0) != 0) {
   if (lockf(fd, F_LOCK, 0) != 0) {
 #else
 #else
   if (flock(fd, LOCK_EX) != 0) {
   if (flock(fd, LOCK_EX) != 0) {
@@ -2868,7 +2868,7 @@ atomic_read_contents(string &contents) const {
 
 
   contents = string();
   contents = string();
 
 
-#ifdef HAVE_LOCKF
+#ifdef PHAVE_LOCKF
   if (lockf(fd, F_LOCK, 0) != 0) {
   if (lockf(fd, F_LOCK, 0) != 0) {
 #else
 #else
   if (flock(fd, LOCK_EX) != 0) {
   if (flock(fd, LOCK_EX) != 0) {

+ 2 - 2
makepanda/makepanda.py

@@ -2268,7 +2268,7 @@ DTOOL_CONFIG=[
     ("DEFAULT_PATHSEP",                '";"',                    '":"'),
     ("DEFAULT_PATHSEP",                '";"',                    '":"'),
     ("WORDS_BIGENDIAN",                'UNDEF',                  'UNDEF'),
     ("WORDS_BIGENDIAN",                'UNDEF',                  'UNDEF'),
     ("HAVE_OPEN_MASK",                 'UNDEF',                  'UNDEF'),
     ("HAVE_OPEN_MASK",                 'UNDEF',                  'UNDEF'),
-    ("HAVE_LOCKF",                     '1',                      '1'),
+    ("PHAVE_LOCKF",                     '1',                      '1'),
     ("HAVE_WCHAR_T",                   '1',                      '1'),
     ("HAVE_WCHAR_T",                   '1',                      '1'),
     ("HAVE_WSTRING",                   '1',                      '1'),
     ("HAVE_WSTRING",                   '1',                      '1'),
     ("SIMPLE_STRUCT_POINTERS",         '1',                      'UNDEF'),
     ("SIMPLE_STRUCT_POINTERS",         '1',                      'UNDEF'),
@@ -2445,7 +2445,7 @@ def WriteConfigSettings():
         # Android does have RTTI, but we disable it anyway.
         # Android does have RTTI, but we disable it anyway.
         dtool_config["HAVE_RTTI"] = 'UNDEF'
         dtool_config["HAVE_RTTI"] = 'UNDEF'
         dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
         dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
-        dtool_config["HAVE_LOCKF"] = 'UNDEF'
+        dtool_config["PHAVE_LOCKF"] = 'UNDEF'
         dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
         dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
 
 
     if (GetOptimize() <= 2 and GetTarget() == "windows"):
     if (GetOptimize() <= 2 and GetTarget() == "windows"):

+ 2 - 2
panda/src/gobj/vertexDataSaveFile.cxx

@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <errno.h>
 #endif  // _WIN32
 #endif  // _WIN32
 
 
-#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
+#if defined(__ANDROID__) && !defined(PHAVE_LOCKF)
 // Needed for flock.
 // Needed for flock.
 #include <sys/file.h>
 #include <sys/file.h>
 #endif
 #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
     // Now try to lock the file, so we can be sure that no other process is
     // simultaneously writing to the same save file.
     // simultaneously writing to the same save file.
-#ifdef HAVE_LOCKF
+#ifdef PHAVE_LOCKF
     int result = lockf(_fd, F_TLOCK, 0);
     int result = lockf(_fd, F_TLOCK, 0);
 #else
 #else
     int result = flock(_fd, LOCK_EX | LOCK_NB);
     int result = flock(_fd, LOCK_EX | LOCK_NB);