On 09/23/12 12:15, Liviu Nicoara wrote:
On 09/22/12 00:51, Liviu Nicoara wrote:
Optimized (but not debug) builds fail to compile setlocale.cpp with the error:
A patch and a comment have been attached to the issue.
I am posting it here to save a trip to the JIRA issue. Any feed-back is
appreciated.
"The issue can be tracked down to the interaction between the definition of
_XOPEN_SOURCE in src/setlocale.cpp and util/path.cpp, the system headers, and Solaris
Studio C . It seems that the original purpose for the definitions has been lost because
both S_IFDIR and symlink are defined and declared, respectively, on modern Linux (edit:
by default). Moreover, it seems that the original definition of _XOPEN_SOURCE was
incorrect, without a value. I propose we remove the two blocks – see the patch."
Thanks,
Liviu
Index: src/setlocale.cpp
===================================================================
--- src/setlocale.cpp (revision 1388733)
+++ src/setlocale.cpp (working copy)
@@ -33,11 +33,6 @@
#include <rw/_defs.h>
-#if defined (__linux__) && !defined (_XOPEN_SOURCE)
- // need S_IFDIR on Linux
-# define _XOPEN_SOURCE
-#endif // __linux__ && !_XOPEN_SOURCE
-
#include <locale.h> // for setlocale()
#include <stdlib.h> // for getenv()
#include <string.h> // for memcpy(), strcmp()
Index: util/path.cpp
===================================================================
--- util/path.cpp (revision 1388733)
+++ util/path.cpp (working copy)
@@ -27,16 +27,6 @@
**************************************************************************/
#ifndef _WIN32
-# ifdef __linux__
- // for symlink()
-# ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE
-# endif
-# ifndef _XOPEN_SOURCE_EXTENDED
-# define _XOPEN_SOURCE_EXTENDED
-# endif
-# endif // __linux__
-
# include <unistd.h> // for getcwd()
# include <sys/stat.h> // for struct stat, stat()
#else