Commits

Boroondas Gupte committed ec656de

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.

Comments (0)

Files changed (5)

doc/contributions.txt

 blino Nakamura
 	VWR-17
 Boroondas Gupte
+	OPEN-29
 	SNOW-278
 	SNOW-503
 	SNOW-510

indra/llvfs/lldir_linux.h

  * $/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
 

indra/llvfs/lldir_mac.h

  * $/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
 

indra/llvfs/lldir_solaris.h

  * $/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
 

indra/llvfs/lldir_win32.h

  * $/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