From 1135f6fff614fd5752dc0261f06dc8e390b4ab45 Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 11 Oct 2017 12:16:33 +0100 Subject: [PATCH] Fixed a compiler warning involving deprecated static variables when compiling with GCC --- modules/juce_core/files/juce_File.h | 4 ++-- modules/juce_core/native/juce_posix_SharedCode.h | 6 ++++-- modules/juce_core/native/juce_win32_Files.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index 4bbe8cab20..0520f8de03 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -35,7 +35,7 @@ namespace juce @see FileInputStream, FileOutputStream */ -class JUCE_API File final +class JUCE_API File final { public: //============================================================================== @@ -1027,7 +1027,7 @@ public: bool foldersFirst; }; - #ifndef DOXYGEN + #if (! defined(DOXYGEN)) && (! defined (JUCE_GCC)) // Deprecated: use File::getSeparatorChar() and File::getSeparatorString() instead! JUCE_DEPRECATED (static const juce_wchar separator); JUCE_DEPRECATED (static const StringRef separatorString); diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index b07279e16e..ead34e6a6b 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -187,8 +187,10 @@ static MaxNumFileHandlesInitialiser maxNumFileHandlesInitialiser; #endif //============================================================================== -const juce_wchar File::separator = '/'; -const StringRef File::separatorString ("/"); +#ifndef JUCE_GCC + const juce_wchar File::separator = '/'; + const StringRef File::separatorString ("/"); +#endif juce_wchar File::getSeparatorChar() { return '/'; } StringRef File::getSeparatorString() { return "/"; } diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index b93f74402d..25ff277a62 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -128,8 +128,10 @@ namespace WindowsFileHelpers } //============================================================================== -const juce_wchar File::separator = '\\'; -const StringRef File::separatorString ("\\"); +#ifndef JUCE_GCC + const juce_wchar File::separator = '\\'; + const StringRef File::separatorString ("\\"); +#endif juce_wchar File::getSeparatorChar() { return '\\'; } StringRef File::getSeparatorString() { return "\\"; }