new additions from ppremake

This commit is contained in:
David Rose 2002-06-03 17:23:43 +00:00
parent 306bbd1bfe
commit 1c41cfeac0

View File

@ -59,7 +59,7 @@
// pathnames. // pathnames.
#ifdef HAVE_CYGWIN #ifdef HAVE_CYGWIN
extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32); extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32);
//extern "C" void cygwin_conv_to_posix_path(const char *path, char *posix); extern "C" void cygwin_conv_to_posix_path(const char *path, char *posix);
#endif #endif
static string static string
@ -1294,7 +1294,21 @@ bool Filename::
touch() const { touch() const {
#ifdef HAVE_UTIME_H #ifdef HAVE_UTIME_H
// Most Unix systems can do this explicitly. // Most Unix systems can do this explicitly.
string os_specific = to_os_specific(); string os_specific = to_os_specific();
#ifdef HAVE_CYGWIN
// In the Cygwin case, it seems we need to be sure to use the
// Cygwin-style name; some broken utime() implementation. That's
// almost the same thing as the original Panda-style name, but not
// exactly, so we first convert the Panda name to a Windows name,
// then convert it back to Cygwin, to ensure we get it exactly right
// by Cygwin rules.
{
char result[4096] = "";
cygwin_conv_to_posix_path(os_specific.c_str(), result);
os_specific = result;
}
#endif // HAVE_CYGWIN
int result = utime(os_specific.c_str(), NULL); int result = utime(os_specific.c_str(), NULL);
if (result < 0) { if (result < 0) {
if (errno == ENOENT) { if (errno == ENOENT) {
@ -1311,14 +1325,14 @@ touch() const {
return false; return false;
} }
return true; return true;
#else #else // HAVE_UTIME_H
// Other systems may not have an explicit control over the // Other systems may not have an explicit control over the
// modification time. For these systems, we'll just temporarily // modification time. For these systems, we'll just temporarily
// open the file in append mode, then close it again (it gets closed // open the file in append mode, then close it again (it gets closed
// when the ofstream goes out of scope). // when the ofstream goes out of scope).
ofstream file; ofstream file;
return open_append(file); return open_append(file);
#endif #endif // HAVE_UTIME_H
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////