COMP: Attempt to fix problem with building on SGI

This commit is contained in:
Andy Cedilnik 2005-04-19 18:26:40 -04:00
parent c98bd6249a
commit 1e04844de9
2 changed files with 190 additions and 151 deletions

View File

@ -39,7 +39,27 @@
#include <curses.h> #include <curses.h>
#include <eti.h> #include <eti.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef __cplusplus
#ifndef va_list
/*
Some compilers move va_list into the std:: namespace and there is no way to
tell that this has been done. Playing with things being included before or
after stdarg.h does not solve things because we do not have control over what
the user does.
This hack solves this problem by moving va_list to our own namespace that is
local for forms.
*/
namespace std {} /* Required for platforms that do not have std:: */
namespace cmakeForms_VA_LIST
{
using namespace std;
typedef va_list hack_va_list;
}
#define va_list cmakeForms_VA_LIST::hack_va_list
#endif /* va_list */
#endif /* __cplusplus */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -22,7 +22,26 @@
#include <@KWSYS_NAMESPACE@/Configure.h> #include <@KWSYS_NAMESPACE@/Configure.h>
#include <sys/types.h> #include <sys/types.h>
// Required for va_list
#include <stdarg.h> #include <stdarg.h>
#ifndef va_list
// Some compilers move va_list into the std:: namespace and there is no way to
// tell that this has been done. Playing with things being included before or
// after stdarg.h does not solve things because we do not have control over
// what the user does. This hack solves this problem by moving va_list to our
// own namespace that is local for kwsys.
namespace std {} // Required for platforms that do not have std::
namespace @KWSYS_NAMESPACE@_VA_LIST
{
using namespace std;
typedef va_list hack_va_list;
}
namespace @KWSYS_NAMESPACE@
{
typedef @KWSYS_NAMESPACE@_VA_LIST::hack_va_list va_list;
}
#endif // va_list
#if defined( _MSC_VER ) #if defined( _MSC_VER )
typedef unsigned short mode_t; typedef unsigned short mode_t;