1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Posix file-time-setting fix. Warning removal for intel compiler.

This commit is contained in:
Julian Storer 2011-01-21 17:50:32 +00:00
parent eb24745a3f
commit 17040ecd02
10 changed files with 72 additions and 36 deletions

View file

@ -65,7 +65,7 @@
#include "../src/native/windows/juce_win32_NativeIncludes.h"
#elif JUCE_LINUX
#include "../src/native/linux/juce_linux_NativeIncludes.h"
#elif JUCE_MAC || JUCE_IPHONE
#elif JUCE_MAC || JUCE_IOS
#include "../src/native/mac/juce_mac_NativeIncludes.h"
#else
#error "Unknown platform!"
@ -405,7 +405,7 @@
#include "../src/native/linux/juce_linux_NativeCode.cpp"
#endif
#if JUCE_MAC || JUCE_IPHONE
#if JUCE_MAC || JUCE_IOS
#include "../src/native/mac/juce_mac_NativeCode.mm"
#endif
#endif

View file

@ -43,7 +43,7 @@ public:
//==============================================================================
void initialise (const String& /*commandLine*/)
{
#if JUCE_IPHONE
#if JUCE_IOS
theMainWindow.setVisible (true);
theMainWindow.setFullScreen (true);
#else

View file

@ -38,12 +38,12 @@
#include <GL/gl.h>
#include <GL/glut.h>
#undef KeyPress
#elif JUCE_IPHONE
#elif JUCE_IOS
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>
#elif JUCE_MAC
#include <GLUT/glut.h>
#elif JUCE_IPHONE
#elif JUCE_IOS
//#include <GL/glut.h>
#endif
@ -60,7 +60,7 @@ public:
: rotation (0.0f),
delta (1.0f)
{
#if JUCE_IPHONE
#if JUCE_IOS
// (On the iPhone, choose a format without a depth buffer)
setPixelFormat (OpenGLPixelFormat (8, 8, 0, 0));
#endif
@ -109,7 +109,7 @@ public:
// we'll use the opportunity to create the textures needed.
void newOpenGLContextCreated()
{
#if ! JUCE_IPHONE
#if ! JUCE_IOS
// (no need to call makeCurrentContextActive(), as that will have
// been done for us before the method call).
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
@ -154,7 +154,7 @@ public:
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
#if JUCE_IPHONE
#if JUCE_IOS
const GLfloat vertices[] = { -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f };
const GLubyte colours[] = { 255, 255, 0, 255, 0, 255, 255, 255, 0, 0, 0, 0, 255, 0, 255, 255 };

View file

@ -29,7 +29,7 @@
// include the JUCE headers..
#include "../JuceLibraryCode/JuceHeader.h"
#if JUCE_IPHONE || JUCE_LINUX
#if JUCE_IOS || JUCE_LINUX
#undef JUCE_USE_CAMERA
#endif

3
juce.h
View file

@ -54,6 +54,9 @@ BEGIN_JUCE_NAMESPACE
#pragma pack (push, 8)
#pragma warning (push)
#pragma warning (disable: 4786) // (old vc6 warning about long class names)
#ifdef __INTEL_COMPILER
#pragma warning (disable: 1125)
#endif
#endif
// this is where all the class header files get brought in..

View file

@ -497,6 +497,10 @@
#if JUCE_MSVC
#pragma warning (push)
#pragma warning (disable : 4100 4201 4514 4312 4995)
#ifdef __INTEL_COMPILER
#pragma warning (disable: 1125)
#endif
#endif
#define _WIN32_WINNT 0x0500
@ -849,7 +853,7 @@ protected:
/*** End of inlined file: juce_linux_NativeIncludes.h ***/
#elif JUCE_MAC || JUCE_IPHONE
#elif JUCE_MAC || JUCE_IOS
/*** Start of inlined file: juce_mac_NativeIncludes.h ***/
#ifndef __JUCE_MAC_NATIVEINCLUDES_JUCEHEADER__
@ -254122,21 +254126,29 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int
bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const
{
struct utimbuf times;
times.actime = (time_t) (accessTime / 1000);
times.modtime = (time_t) (modificationTime / 1000);
juce_statStruct info;
return utime (fullPath.toUTF8(), &times) == 0;
if ((modificationTime != 0 || accessTime != 0) && juce_stat (fullPath, info))
{
struct utimbuf times;
times.actime = accessTime != 0 ? (time_t) (accessTime / 1000) : info.st_atime;
times.modtime = modificationTime != 0 ? (time_t) (modificationTime / 1000) : info.st_mtime;
return utime (fullPath.toUTF8(), &times) == 0;
}
return false;
}
bool File::deleteFile() const
{
if (! exists())
return true;
else if (isDirectory())
if (isDirectory())
return rmdir (fullPath.toUTF8()) == 0;
else
return remove (fullPath.toUTF8()) == 0;
return remove (fullPath.toUTF8()) == 0;
}
bool File::moveInternal (const File& dest) const
@ -262520,7 +262532,7 @@ END_JUCE_NAMESPACE
#endif
#if JUCE_MAC || JUCE_IPHONE
#if JUCE_MAC || JUCE_IOS
/*** Start of inlined file: juce_mac_NativeCode.mm ***/
/*
@ -264001,21 +264013,29 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int
bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const
{
struct utimbuf times;
times.actime = (time_t) (accessTime / 1000);
times.modtime = (time_t) (modificationTime / 1000);
juce_statStruct info;
return utime (fullPath.toUTF8(), &times) == 0;
if ((modificationTime != 0 || accessTime != 0) && juce_stat (fullPath, info))
{
struct utimbuf times;
times.actime = accessTime != 0 ? (time_t) (accessTime / 1000) : info.st_atime;
times.modtime = modificationTime != 0 ? (time_t) (modificationTime / 1000) : info.st_mtime;
return utime (fullPath.toUTF8(), &times) == 0;
}
return false;
}
bool File::deleteFile() const
{
if (! exists())
return true;
else if (isDirectory())
if (isDirectory())
return rmdir (fullPath.toUTF8()) == 0;
else
return remove (fullPath.toUTF8()) == 0;
return remove (fullPath.toUTF8()) == 0;
}
bool File::moveInternal (const File& dest) const

View file

@ -3349,6 +3349,9 @@ BEGIN_JUCE_NAMESPACE
#pragma pack (push, 8)
#pragma warning (push)
#pragma warning (disable: 4786) // (old vc6 warning about long class names)
#ifdef __INTEL_COMPILER
#pragma warning (disable: 1125)
#endif
#endif
// this is where all the class header files get brought in..
@ -60739,8 +60742,7 @@ public:
For keycode info, see the KeyPress class.
Returns true if the keystroke was used.
*/
bool handleKeyPress (int keyCode,
juce_wchar textCharacter);
bool handleKeyPress (int keyCode, juce_wchar textCharacter);
/** Called whenever a key is pressed or released.
Returns true if the keystroke was used.

View file

@ -270,8 +270,7 @@ public:
For keycode info, see the KeyPress class.
Returns true if the keystroke was used.
*/
bool handleKeyPress (int keyCode,
juce_wchar textCharacter);
bool handleKeyPress (int keyCode, juce_wchar textCharacter);
/** Called whenever a key is pressed or released.
Returns true if the keystroke was used.

View file

@ -347,21 +347,29 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int
bool File::setFileTimesInternal (int64 modificationTime, int64 accessTime, int64 /*creationTime*/) const
{
struct utimbuf times;
times.actime = (time_t) (accessTime / 1000);
times.modtime = (time_t) (modificationTime / 1000);
juce_statStruct info;
return utime (fullPath.toUTF8(), &times) == 0;
if ((modificationTime != 0 || accessTime != 0) && juce_stat (fullPath, info))
{
struct utimbuf times;
times.actime = accessTime != 0 ? (time_t) (accessTime / 1000) : info.st_atime;
times.modtime = modificationTime != 0 ? (time_t) (modificationTime / 1000) : info.st_mtime;
return utime (fullPath.toUTF8(), &times) == 0;
}
return false;
}
bool File::deleteFile() const
{
if (! exists())
return true;
else if (isDirectory())
if (isDirectory())
return rmdir (fullPath.toUTF8()) == 0;
else
return remove (fullPath.toUTF8()) == 0;
return remove (fullPath.toUTF8()) == 0;
}
bool File::moveInternal (const File& dest) const

View file

@ -41,6 +41,10 @@
#if JUCE_MSVC
#pragma warning (push)
#pragma warning (disable : 4100 4201 4514 4312 4995)
#ifdef __INTEL_COMPILER
#pragma warning (disable: 1125)
#endif
#endif
#define _WIN32_WINNT 0x0500