Browse Source

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

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
17040ecd02
10 changed files with 72 additions and 36 deletions
  1. +2
    -2
      amalgamation/juce_amalgamated_template.cpp
  2. +1
    -1
      extras/juce demo/Source/ApplicationStartup.cpp
  3. +5
    -5
      extras/juce demo/Source/demos/OpenGLDemo.cpp
  4. +1
    -1
      extras/juce demo/Source/jucedemo_headers.h
  5. +3
    -0
      juce.h
  6. +36
    -16
      juce_amalgamated.cpp
  7. +4
    -2
      juce_amalgamated.h
  8. +1
    -2
      src/gui/components/windows/juce_ComponentPeer.h
  9. +15
    -7
      src/native/common/juce_posix_SharedCode.h
  10. +4
    -0
      src/native/windows/juce_win32_NativeIncludes.h

+ 2
- 2
amalgamation/juce_amalgamated_template.cpp 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

+ 1
- 1
extras/juce demo/Source/ApplicationStartup.cpp 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


+ 5
- 5
extras/juce demo/Source/demos/OpenGLDemo.cpp 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 };


+ 1
- 1
extras/juce demo/Source/jucedemo_headers.h 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
- 0
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..


+ 36
- 16
juce_amalgamated.cpp 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;

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 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


+ 4
- 2
juce_amalgamated.h 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.


+ 1
- 2
src/gui/components/windows/juce_ComponentPeer.h 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.


+ 15
- 7
src/native/common/juce_posix_SharedCode.h 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;
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 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


+ 4
- 0
src/native/windows/juce_win32_NativeIncludes.h 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


Loading…
Cancel
Save