From 29b3207fe433497c60feff0b1f71b7fdb27412e1 Mon Sep 17 00:00:00 2001
From: Boroondas Gupte <hg@boroon.dasgupta.ch>
Date: Fri, 11 Feb 2011 01:27:01 +0100
Subject: OPEN-29 Error out if lldir_<platform>.h is included when building for
 a different platform

As far as I know, there is no good reason to include e.g.
indra/llvfs/lldir_win32.h while not building for a windows target, so be
better prevent this to avoid hard to find errors.
---
 indra/llvfs/lldir_linux.h   | 4 ++++
 indra/llvfs/lldir_mac.h     | 4 ++++
 indra/llvfs/lldir_solaris.h | 4 ++++
 indra/llvfs/lldir_win32.h   | 4 ++++
 4 files changed, 16 insertions(+)

(limited to 'indra/llvfs')

diff --git a/indra/llvfs/lldir_linux.h b/indra/llvfs/lldir_linux.h
index 451e81ae93..c7cfe905f5 100644
--- a/indra/llvfs/lldir_linux.h
+++ b/indra/llvfs/lldir_linux.h
@@ -24,6 +24,10 @@
  * $/LicenseInfo$
  */
 
+#if !LL_LINUX
+#error This header must not be included when compiling for any target other than Linux. Consider including lldir.h instead.
+#endif // !LL_LINUX
+
 #ifndef LL_LLDIR_LINUX_H
 #define LL_LLDIR_LINUX_H
 
diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h
index 4eac3c3ae6..6bde458bf6 100644
--- a/indra/llvfs/lldir_mac.h
+++ b/indra/llvfs/lldir_mac.h
@@ -24,6 +24,10 @@
  * $/LicenseInfo$
  */
 
+#if !LL_DARWIN
+#error This header must not be included when compiling for any target other than Mac OS. Consider including lldir.h instead.
+#endif // !LL_DARWIN
+
 #ifndef LL_LLDIR_MAC_H
 #define LL_LLDIR_MAC_H
 
diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h
index 4a1794f539..b48752d362 100644
--- a/indra/llvfs/lldir_solaris.h
+++ b/indra/llvfs/lldir_solaris.h
@@ -24,6 +24,10 @@
  * $/LicenseInfo$
  */
 
+#if !LL_SOLARIS
+#error This header must not be included when compiling for any target other than Solaris. Consider including lldir.h instead.
+#endif // !LL_SOLARIS
+
 #ifndef LL_LLDIR_SOLARIS_H
 #define LL_LLDIR_SOLARIS_H
 
diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h
index 4c932c932c..1d0a692883 100644
--- a/indra/llvfs/lldir_win32.h
+++ b/indra/llvfs/lldir_win32.h
@@ -24,6 +24,10 @@
  * $/LicenseInfo$
  */
 
+#if !LL_WINDOWS
+#error This header must not be included when compiling for any target other than Windows. Consider including lldir.h instead.
+#endif // !LL_WINDOWS
+
 #ifndef LL_LLDIR_WIN32_H
 #define LL_LLDIR_WIN32_H
 
-- 
cgit v1.2.3


From 627c7634398e03145f297e91a8e93c0bbba00e33 Mon Sep 17 00:00:00 2001
From: Boroondas Gupte <hg@boroon.dasgupta.ch>
Date: Fri, 11 Feb 2011 01:35:21 +0100
Subject: =?UTF-8?q?OPEN-29=20Cleanup:=20removed=20extra=20qualification=20?=
 =?UTF-8?q?=E2=80=98LLDir=5FWin32::=E2=80=99=20on=20member=20=E2=80=98getN?=
 =?UTF-8?q?extFileInDir=E2=80=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Before OPEN-29, when lldir_win32.h would have been included when
building for Linux, GCC would error out with
	indra/llvfs/lldir_win32.h:50: error: extra qualification ‘LLDir_Win32::’ on member ‘getNextFileInDir’
which, although unintended, probably was a Good Thing (TM), as this
would have aborted the build, so that the wrong include would be
noticed. Now that we explicitly error out with a (hopefully) useful
error message, this isn't needed anymore.
---
 indra/llvfs/lldir_win32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llvfs')

diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h
index 1d0a692883..8a97a248dd 100644
--- a/indra/llvfs/lldir_win32.h
+++ b/indra/llvfs/lldir_win32.h
@@ -51,7 +51,7 @@ public:
 	/*virtual*/ std::string getLLPluginFilename(std::string base_name);
 
 private:
-	BOOL LLDir_Win32::getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname);
+	BOOL getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname);
 	
 	void* mDirSearch_h;
 	llutf16string mCurrentDir;
-- 
cgit v1.2.3


From 1c931920af96e8ef4fd7f923b58f23b2bee869ee Mon Sep 17 00:00:00 2001
From: Boroondas Gupte <hg@boroon.dasgupta.ch>
Date: Fri, 11 Feb 2011 01:41:34 +0100
Subject: OPEN-29 Cleanup: removed superflous "public:"

Not related, just a while-I'm-at-it thing.
---
 indra/llvfs/lldir_linux.h   | 2 +-
 indra/llvfs/lldir_mac.h     | 2 +-
 indra/llvfs/lldir_solaris.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'indra/llvfs')

diff --git a/indra/llvfs/lldir_linux.h b/indra/llvfs/lldir_linux.h
index c7cfe905f5..6015b25faa 100644
--- a/indra/llvfs/lldir_linux.h
+++ b/indra/llvfs/lldir_linux.h
@@ -44,7 +44,7 @@ public:
 
 	/*virtual*/ void initAppDirs(const std::string &app_name,
 		const std::string& app_read_only_data_dir);
-public:	
+
 	virtual std::string getCurPath();
 	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
 	virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h
index 6bde458bf6..b456d3afca 100644
--- a/indra/llvfs/lldir_mac.h
+++ b/indra/llvfs/lldir_mac.h
@@ -43,7 +43,7 @@ public:
 
 	/*virtual*/ void initAppDirs(const std::string &app_name,
 		const std::string& app_read_only_data_dir);
-public:	
+
 	virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask);
 	virtual std::string getCurPath();
 	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h
index b48752d362..5623254758 100644
--- a/indra/llvfs/lldir_solaris.h
+++ b/indra/llvfs/lldir_solaris.h
@@ -44,7 +44,7 @@ public:
 
 	/*virtual*/ void initAppDirs(const std::string &app_name,
 		const std::string& app_read_only_data_dir);
-public:	
+
 	virtual std::string getCurPath();
 	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
 	virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
-- 
cgit v1.2.3


From 1d0001020716d3f3d3734dd4a4f8cd609bc2b215 Mon Sep 17 00:00:00 2001
From: Boroondas Gupte <hg@boroon.dasgupta.ch>
Date: Fri, 11 Feb 2011 02:09:20 +0100
Subject: OPEN-29 Cleanup: strip trailing whitespace

As people will have to rebuild half the tree anyway, because these
headers changed, we might as well prettify them a bit.
---
 indra/llvfs/lldir_linux.h   | 4 ++--
 indra/llvfs/lldir_solaris.h | 2 +-
 indra/llvfs/lldir_win32.h   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'indra/llvfs')

diff --git a/indra/llvfs/lldir_linux.h b/indra/llvfs/lldir_linux.h
index 6015b25faa..a34de1241d 100644
--- a/indra/llvfs/lldir_linux.h
+++ b/indra/llvfs/lldir_linux.h
@@ -1,6 +1,6 @@
 /** 
  * @file lldir_linux.h
- * @brief Definition of directory utilities class for linux 
+ * @brief Definition of directory utilities class for linux
  *
  * $LicenseInfo:firstyear=2000&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -57,7 +57,7 @@ private:
 	DIR *mDirp;
 	int mCurrentDirIndex;
 	int mCurrentDirCount;
-	std::string mCurrentDir;	
+	std::string mCurrentDir;
 };
 
 #endif // LL_LLDIR_LINUX_H
diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h
index 5623254758..70fac6f818 100644
--- a/indra/llvfs/lldir_solaris.h
+++ b/indra/llvfs/lldir_solaris.h
@@ -54,7 +54,7 @@ private:
 	DIR *mDirp;
 	int mCurrentDirIndex;
 	int mCurrentDirCount;
-	std::string mCurrentDir;	
+	std::string mCurrentDir;
 };
 
 #endif // LL_LLDIR_SOLARIS_H
diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h
index 8a97a248dd..b170ebbcd7 100644
--- a/indra/llvfs/lldir_win32.h
+++ b/indra/llvfs/lldir_win32.h
@@ -52,7 +52,7 @@ public:
 
 private:
 	BOOL getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname);
-	
+
 	void* mDirSearch_h;
 	llutf16string mCurrentDir;
 };
-- 
cgit v1.2.3