mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
More PHAVE fixes
This commit is contained in:
parent
45ad239e59
commit
bdb3d15332
@ -18,7 +18,7 @@
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "gnu_getopt.h"
|
||||
#else
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#ifdef PHAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1755,7 +1755,7 @@ scan_directory(vector_string &contents) const {
|
||||
sort(contents.begin() + orig_size, contents.end());
|
||||
return scan_ok;
|
||||
|
||||
#elif defined(HAVE_DIRENT_H)
|
||||
#elif defined(PHAVE_DIRENT_H)
|
||||
// Use Posix's opendir() / readir() to walk through the list of
|
||||
// files in a directory.
|
||||
size_t orig_size = contents.size();
|
||||
@ -1801,7 +1801,7 @@ scan_directory(vector_string &contents) const {
|
||||
sort(contents.begin() + orig_size, contents.end());
|
||||
return true;
|
||||
|
||||
#elif defined(HAVE_GLOB_H)
|
||||
#elif defined(PHAVE_GLOB_H)
|
||||
// It's hard to imagine a system that provides glob.h but does not
|
||||
// provide openddir() .. readdir(), but this code is leftover from a
|
||||
// time when there was an undetected bug in the above readdir()
|
||||
@ -2318,7 +2318,7 @@ touch() const {
|
||||
CloseHandle(fhandle);
|
||||
return true;
|
||||
|
||||
#elif defined(HAVE_UTIME_H)
|
||||
#elif defined(PHAVE_UTIME_H)
|
||||
// Most Unix systems can do this explicitly.
|
||||
|
||||
string os_specific = to_os_specific();
|
||||
@ -2351,14 +2351,14 @@ touch() const {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else // WIN32, HAVE_UTIME_H
|
||||
#else // WIN32, PHAVE_UTIME_H
|
||||
// Other systems may not have an explicit control over the
|
||||
// modification time. For these systems, we'll just temporarily
|
||||
// open the file in append mode, then close it again (it gets closed
|
||||
// when the pfstream goes out of scope).
|
||||
pfstream file;
|
||||
return open_append(file);
|
||||
#endif // WIN32, HAVE_UTIME_H
|
||||
#endif // WIN32, PHAVE_UTIME_H
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -332,5 +332,5 @@ switch_to_thread_context(struct ThreadContext *context) {
|
||||
abort();
|
||||
}
|
||||
|
||||
#endif /* HAVE_UCONTEXT_H */
|
||||
#endif /* PHAVE_UCONTEXT_H */
|
||||
#endif /* THREAD_SIMPLE_IMPL */
|
||||
|
@ -46,7 +46,7 @@ struct ThreadContext {
|
||||
#endif
|
||||
};
|
||||
|
||||
#else /* HAVE_UCONTEXT_H */
|
||||
#else /* PHAVE_UCONTEXT_H */
|
||||
/* Unfortunately, setcontext() is not defined everywhere (even though
|
||||
it claims to be adopted by Posix). So we have to fall back to
|
||||
setjmp() / longjmp() in its absence. This is a hackier solution. */
|
||||
@ -84,7 +84,7 @@ struct ThreadContext {
|
||||
cs_jmp_buf _jmp_context;
|
||||
};
|
||||
|
||||
#endif /* HAVE_UCONTEXT_H */
|
||||
#endif /* PHAVE_UCONTEXT_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -23,7 +23,7 @@ main(int argc, char *argv[]) {
|
||||
// bother trying to compile this program (it may not compile
|
||||
// anyway).
|
||||
|
||||
#ifndef HAVE_UCONTEXT_H
|
||||
#ifndef PHAVE_UCONTEXT_H
|
||||
jmp_buf buf1, buf2;
|
||||
char * volatile scratch;
|
||||
|
||||
@ -41,7 +41,7 @@ main(int argc, char *argv[]) {
|
||||
}
|
||||
cerr << "scratch = " << (void *)scratch << "\n";
|
||||
cerr << "scratch end = " << (void *)(scratch + 1024) << "\n";
|
||||
#endif // HAVE_UCONTEXT_H
|
||||
#endif // PHAVE_UCONTEXT_H
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user