Browse Source

Minor updates for mingw compatibility.

tags/2021-05-28
jules 12 years ago
parent
commit
976be45c2a
7 changed files with 17 additions and 29 deletions
  1. +4
    -19
      modules/juce_core/files/juce_File.h
  2. +1
    -1
      modules/juce_core/maths/juce_MathsFunctions.h
  3. +0
    -6
      modules/juce_core/memory/juce_Memory.h
  4. +5
    -1
      modules/juce_core/native/juce_BasicNativeHeaders.h
  5. +5
    -0
      modules/juce_core/system/juce_TargetPlatform.h
  6. +1
    -1
      modules/juce_gui_basics/juce_gui_basics.cpp
  7. +1
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 4
- 19
modules/juce_core/files/juce_File.h View File

@@ -355,13 +355,11 @@ public:
bool applyRecursively = false) const; bool applyRecursively = false) const;
/** Returns true if this file is a hidden or system file. /** Returns true if this file is a hidden or system file.
The criteria for deciding whether a file is hidden are platform-dependent. The criteria for deciding whether a file is hidden are platform-dependent.
*/ */
bool isHidden() const; bool isHidden() const;
/** If this file is a link, this returns the file that it points to. /** If this file is a link, this returns the file that it points to.
If this file isn't actually link, it'll just return itself. If this file isn't actually link, it'll just return itself.
*/ */
File getLinkedTarget() const; File getLinkedTarget() const;
@@ -695,13 +693,11 @@ public:
static void findFileSystemRoots (Array<File>& results); static void findFileSystemRoots (Array<File>& results);
/** Finds the name of the drive on which this file lives. /** Finds the name of the drive on which this file lives.
@returns the volume label of the drive, or an empty string if this isn't possible @returns the volume label of the drive, or an empty string if this isn't possible
*/ */
String getVolumeLabel() const; String getVolumeLabel() const;
/** Returns the serial number of the volume on which this file lives. /** Returns the serial number of the volume on which this file lives.
@returns the serial number, or zero if there's a problem doing this @returns the serial number, or zero if there's a problem doing this
*/ */
int getVolumeSerialNumber() const; int getVolumeSerialNumber() const;
@@ -790,7 +786,6 @@ public:
commonApplicationDataDirectory, commonApplicationDataDirectory,
/** The folder that should be used for temporary files. /** The folder that should be used for temporary files.
Always delete them when you're finished, to keep the user's computer tidy! Always delete them when you're finished, to keep the user's computer tidy!
*/ */
tempDirectory, tempDirectory,
@@ -829,18 +824,15 @@ public:
hostApplicationPath, hostApplicationPath,
/** The directory in which applications normally get installed. /** The directory in which applications normally get installed.
So on windows, this would be something like "c:\program files", on the So on windows, this would be something like "c:\program files", on the
Mac "/Applications", or "/usr" on linux. Mac "/Applications", or "/usr" on linux.
*/ */
globalApplicationsDirectory, globalApplicationsDirectory,
/** The most likely place where a user might store their music files.
*/
/** The most likely place where a user might store their music files. */
userMusicDirectory, userMusicDirectory,
/** The most likely place where a user might store their movie files.
*/
/** The most likely place where a user might store their movie files. */
userMoviesDirectory, userMoviesDirectory,
}; };
@@ -853,9 +845,7 @@ public:
//============================================================================== //==============================================================================
/** Returns a temporary file in the system's temp directory. /** Returns a temporary file in the system's temp directory.
This will try to return the name of a non-existent temp file. This will try to return the name of a non-existent temp file.
To get the temp folder, you can use getSpecialLocation (File::tempDirectory). To get the temp folder, you can use getSpecialLocation (File::tempDirectory).
*/ */
static File createTempFile (const String& fileNameEnding); static File createTempFile (const String& fileNameEnding);
@@ -863,7 +853,6 @@ public:
//============================================================================== //==============================================================================
/** Returns the current working directory. /** Returns the current working directory.
@see setAsCurrentWorkingDirectory @see setAsCurrentWorkingDirectory
*/ */
static File getCurrentWorkingDirectory(); static File getCurrentWorkingDirectory();
@@ -879,13 +868,11 @@ public:
//============================================================================== //==============================================================================
/** The system-specific file separator character. /** The system-specific file separator character.
On Windows, this will be '\', on Mac/Linux, it'll be '/' On Windows, this will be '\', on Mac/Linux, it'll be '/'
*/ */
static const juce_wchar separator; static const juce_wchar separator;
/** The system-specific file separator character, as a string. /** The system-specific file separator character, as a string.
On Windows, this will be '\', on Mac/Linux, it'll be '/' On Windows, this will be '\', on Mac/Linux, it'll be '/'
*/ */
static const String separatorString; static const String separatorString;
@@ -912,12 +899,10 @@ public:
*/ */
static String createLegalPathName (const String& pathNameToFix); static String createLegalPathName (const String& pathNameToFix);
/** Indicates whether filenames are case-sensitive on the current operating system.
*/
/** Indicates whether filenames are case-sensitive on the current operating system. */
static bool areFileNamesCaseSensitive(); static bool areFileNamesCaseSensitive();
/** Returns true if the string seems to be a fully-specified absolute path.
*/
/** Returns true if the string seems to be a fully-specified absolute path. */
static bool isAbsolutePath (const String& path); static bool isAbsolutePath (const String& path);
/** Creates a file that simply contains this string, without doing the sanity-checking /** Creates a file that simply contains this string, without doing the sanity-checking


+ 1
- 1
modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -285,7 +285,7 @@ inline int numElementsInArray (Type (&array)[N])
template <typename Type> template <typename Type>
inline Type juce_hypot (Type a, Type b) noexcept inline Type juce_hypot (Type a, Type b) noexcept
{ {
#if JUCE_WINDOWS
#if JUCE_MSVC
return static_cast <Type> (_hypot (a, b)); return static_cast <Type> (_hypot (a, b));
#else #else
return static_cast <Type> (hypot (a, b)); return static_cast <Type> (hypot (a, b));


+ 0
- 6
modules/juce_core/memory/juce_Memory.h View File

@@ -26,12 +26,6 @@
#ifndef __JUCE_MEMORY_JUCEHEADER__ #ifndef __JUCE_MEMORY_JUCEHEADER__
#define __JUCE_MEMORY_JUCEHEADER__ #define __JUCE_MEMORY_JUCEHEADER__
//==============================================================================
#if JUCE_MINGW
/** This allocator is not defined in mingw gcc. */
#define alloca __builtin_alloca
#endif
//============================================================================== //==============================================================================
/** Fills a block of memory with zeros. */ /** Fills a block of memory with zeros. */
inline void zeromem (void* memory, size_t numBytes) noexcept { memset (memory, 0, numBytes); } inline void zeromem (void* memory, size_t numBytes) noexcept { memset (memory, 0, numBytes); }


+ 5
- 1
modules/juce_core/native/juce_BasicNativeHeaders.h View File

@@ -83,7 +83,11 @@
#define STRICT 1 #define STRICT 1
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#define _WIN32_WINNT 0x0600
#if JUCE_MINGW
#define _WIN32_WINNT 0x0501
#else
#define _WIN32_WINNT 0x0600
#endif
#define _UNICODE 1 #define _UNICODE 1
#define UNICODE 1 #define UNICODE 1
#ifndef _WIN32_IE #ifndef _WIN32_IE


+ 5
- 0
modules/juce_core/system/juce_TargetPlatform.h View File

@@ -81,6 +81,11 @@
#ifdef __MINGW32__ #ifdef __MINGW32__
#define JUCE_MINGW 1 #define JUCE_MINGW 1
#ifdef __MINGW64__
#define JUCE_64BIT 1
#else
#define JUCE_32BIT 1
#endif
#endif #endif
/** If defined, this indicates that the processor is little-endian. */ /** If defined, this indicates that the processor is little-endian. */


+ 1
- 1
modules/juce_gui_basics/juce_gui_basics.cpp View File

@@ -85,7 +85,7 @@
#endif #endif
#if JUCE_MINGW #if JUCE_MINGW
#include <Imm.h>
#include <imm.h>
#endif #endif
//============================================================================== //==============================================================================


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -54,7 +54,7 @@ void* getUser32Function (const char* functionName) // (NB: this function also us
HMODULE user32Mod = GetModuleHandleA ("user32.dll"); HMODULE user32Mod = GetModuleHandleA ("user32.dll");
jassert (user32Mod != 0); jassert (user32Mod != 0);
return static_cast <void*> (GetProcAddress (user32Mod, functionName));
return (void*) GetProcAddress (user32Mod, functionName);
} }
//============================================================================== //==============================================================================


Loading…
Cancel
Save