mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
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
This commit is contained in:
parent
24c8ef9887
commit
a251c6dd8f
@ -48,7 +48,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
|
||||
#if defined(__ANDROID__) && !defined(PHAVE_LOCKF)
|
||||
// Needed for flock.
|
||||
#include <sys/file.h>
|
||||
#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) {
|
||||
|
@ -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"):
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <errno.h>
|
||||
#endif // _WIN32
|
||||
|
||||
#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
|
||||
#if defined(__ANDROID__) && !defined(PHAVE_LOCKF)
|
||||
// Needed for flock.
|
||||
#include <sys/file.h>
|
||||
#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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user