RFA: Ensure All Preprocessor Symbols Are Defined

Jeffrey Oldham oldham at codesourcery.com
Wed Mar 28 18:48:21 UTC 2001


This morning, I learned that all preprocessors symbols should be
defined by the configury code.  I worked with Stephen Smith on these.

OK to commit?

2001-03-28  Jeffrey D. Oldham  <oldham at codesourcery.com>

	* configure (setthreads): Always define
	POOMA_SMARTS_SCHEDULER_SERIALASYNC.
	(setcharacteristics): Define POOMA_NO_STD_MIN_MAX and
	POOMA_NONSTANDARD_ITERATOR.
	* src/Evaluator/ExpressionKernel.h
	(ExpressionKernel::ExpressionKernel): Remove old POOMA_SMARTS_1_0
	code.
	* src/Pooma/PoomaOperatorTags.h (FnMin):
	s/POOMA_BRAIN_DAMAGED_MICROSOFT_LIB/POOMA_NO_STD_MIN_MAX/g
	(FnMax): Likewise.
	(FnMinAssign): Likewise.
	(FnMaxAssign): Likewise.
	* src/Pooma/PETE/PoomaOps.in (binaryOps): Likewise.
	(binaryAssignOps): Likewise.

Tested on	sequential Linux using gcc mainline by compiling Pooma library
Reviewed by	???you???

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: configure
===================================================================
RCS file: /home/pooma/Repository/r2/configure,v
retrieving revision 1.102
diff -c -p -r1.102 configure
*** configure	2001/02/28 00:42:54	1.102
--- configure	2001/03/28 18:33:55
*************** sub setthreads
*** 1411,1416 ****
--- 1411,1417 ----
        if ($scheduler eq "none")
  	{
  	  add_string_define("POOMA_SCHEDULER_NAME", "\"stub scheduler\"");
+ 	  add_yesno_define("POOMA_SMARTS_SCHEDULER_SERIALASYNC", 0);
  	}
        else
  	{
*************** sub setcharacteristics
*** 1743,1748 ****
--- 1744,1757 ----
    # if must include <sys/stat.h> for POSIX file modes, say so
    add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES",
  		   $inc_sys_stat_h_file_modes);
+ 
+   # if the C++ library does not have std::min, std::max, etc.
+   add_yesno_define("POOMA_NO_STD_MIN_MAX",
+ 		   $no_std_min_max);
+ 
+   # if the C++ library has a nonstandard iterator or iterator_traits
+   add_yesno_define("POOMA_NONSTANDARD_ITERATOR",
+ 		   $no_std_iterator);
  }
  
  
Index: src/Evaluator/ExpressionKernel.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Evaluator/ExpressionKernel.h,v
retrieving revision 1.44
diff -c -p -r1.44 ExpressionKernel.h
*** src/Evaluator/ExpressionKernel.h	2000/05/31 02:40:03	1.44
--- src/Evaluator/ExpressionKernel.h	2001/03/28 18:33:59
*************** private:
*** 128,142 ****
  template<class LHS,class Op,class RHS,class EvalTag>
  ExpressionKernel<LHS,Op,RHS,EvalTag>::
  ExpressionKernel(const LHS& lhs,const Op& op,const RHS& rhs)
- #if POOMA_SMARTS_1_0
-   : Pooma::Iterate_t(Pooma::scheduler(),
- 		     engineFunctor(lhs, DataObjectRequest<CountBlocks>()) +
- 		     engineFunctor(rhs, DataObjectRequest<CountBlocks>()),
- 		     -1
- 		     ),
- #else
    : Pooma::Iterate_t(Pooma::scheduler()),
- #endif
      lhs_m(lhs), op_m(op), rhs_m(rhs)
  {
    hintAffinity(engineFunctor(lhs, DataObjectRequest<BlockAffinity>()));
--- 128,134 ----
Index: src/Pooma/PoomaOperatorTags.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/PoomaOperatorTags.h,v
retrieving revision 1.16
diff -c -p -r1.16 PoomaOperatorTags.h
*** src/Pooma/PoomaOperatorTags.h	2000/08/08 17:32:59	1.16
--- src/Pooma/PoomaOperatorTags.h	2001/03/28 18:33:59
*************** struct FnMin
*** 241,247 ****
    operator()(const T1 &a, const T2 &b) const
    {
      return 
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          (a<b?a:b)
  #else
          std::min(a, b)
--- 241,247 ----
    operator()(const T1 &a, const T2 &b) const
    {
      return 
! #if POOMA_NO_STD_MIN_MAX
          (a<b?a:b)
  #else
          std::min(a, b)
*************** struct FnMax
*** 258,264 ****
    operator()(const T1 &a, const T2 &b) const
    {
      return 
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          (a>b?a:b)
  #else
          std::max(a, b)
--- 258,264 ----
    operator()(const T1 &a, const T2 &b) const
    {
      return 
! #if POOMA_NO_STD_MIN_MAX
          (a>b?a:b)
  #else
          std::max(a, b)
*************** struct FnMinAssign
*** 371,377 ****
    operator()(const T1 &a, const T2 &b) const
    {
      
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          const_cast<T1 &>(a) = (a<b?a:b)
  #else
          const_cast<T1 &>(a) = std::min(a, b)
--- 371,377 ----
    operator()(const T1 &a, const T2 &b) const
    {
      
! #if POOMA_NO_STD_MIN_MAX
          const_cast<T1 &>(a) = (a<b?a:b)
  #else
          const_cast<T1 &>(a) = std::min(a, b)
*************** struct FnMaxAssign
*** 394,400 ****
    operator()(const T1 &a, const T2 &b) const
    {
      
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          const_cast<T1 &>(a) = (a>b?a:b)
  #else
          const_cast<T1 &>(a) = std::max(a, b)
--- 394,400 ----
    operator()(const T1 &a, const T2 &b) const
    {
      
! #if POOMA_NO_STD_MIN_MAX
          const_cast<T1 &>(a) = (a>b?a:b)
  #else
          const_cast<T1 &>(a) = std::max(a, b)
Index: src/Pooma/PETE/PoomaOps.in
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/PETE/PoomaOps.in,v
retrieving revision 1.7
diff -c -p -r1.7 PoomaOps.in
*** src/Pooma/PETE/PoomaOps.in	2000/08/08 17:33:02	1.7
--- src/Pooma/PETE/PoomaOps.in	2001/03/28 18:33:59
*************** binaryOps
*** 93,99 ****
    TAG      = "FnMin"
    FUNCTION = "min"
    EXPR     = "return 
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          (a<b?a:b)
  #else
          std::min(a, b)
--- 93,99 ----
    TAG      = "FnMin"
    FUNCTION = "min"
    EXPR     = "return 
! #if POOMA_NO_STD_MIN_MAX
          (a<b?a:b)
  #else
          std::min(a, b)
*************** binaryOps
*** 103,109 ****
    TAG      = "FnMax"
    FUNCTION = "max"
    EXPR     = "return 
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          (a>b?a:b)
  #else
          std::max(a, b)
--- 103,109 ----
    TAG      = "FnMax"
    FUNCTION = "max"
    EXPR     = "return 
! #if POOMA_NO_STD_MIN_MAX
          (a>b?a:b)
  #else
          std::max(a, b)
*************** binaryAssignOps
*** 141,147 ****
    TAG      = "FnMinAssign"
    FUNCTION = "minAssign"
    EXPR     = "
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          const_cast<T1 &>(a) = (a<b?a:b)
  #else
          const_cast<T1 &>(a) = std::min(a, b)
--- 141,147 ----
    TAG      = "FnMinAssign"
    FUNCTION = "minAssign"
    EXPR     = "
! #if POOMA_NO_STD_MIN_MAX
          const_cast<T1 &>(a) = (a<b?a:b)
  #else
          const_cast<T1 &>(a) = std::min(a, b)
*************** binaryAssignOps
*** 152,158 ****
    TAG      = "FnMaxAssign"
    FUNCTION = "maxAssign"
    EXPR     = "
! #if POOMA_BRAIN_DAMAGED_MICROSOFT_LIB
          const_cast<T1 &>(a) = (a>b?a:b)
  #else
          const_cast<T1 &>(a) = std::max(a, b)
--- 152,158 ----
    TAG      = "FnMaxAssign"
    FUNCTION = "maxAssign"
    EXPR     = "
! #if POOMA_NO_STD_MIN_MAX
          const_cast<T1 &>(a) = (a>b?a:b)
  #else
          const_cast<T1 &>(a) = std::max(a, b)


More information about the pooma-dev mailing list