lib/iec_std_lib.h
changeset 638 049748e9410a
parent 625 c0bda77b37a0
child 639 f0ef73eceb57
equal deleted inserted replaced
637:1b6f337222e0 638:049748e9410a
    81 #endif
    81 #endif
    82 
    82 
    83 
    83 
    84 #define __lit(type,value,...) (type)value##__VA_ARGS__
    84 #define __lit(type,value,...) (type)value##__VA_ARGS__
    85 // Keep this macro expention step to let sfx(__VA_ARGS__) change into L or LL
    85 // Keep this macro expention step to let sfx(__VA_ARGS__) change into L or LL
    86 #define __literal(type,value,...) __lit(type,value,##__VA_ARGS__)
    86 #define __literal(type,value,...) __lit(type,value,__VA_ARGS__)
    87 
    87 
    88 #define __BOOL_LITERAL(value) __literal(BOOL,value)
    88 #define __BOOL_LITERAL(value) __literal(BOOL,value)
    89 #define __SINT_LITERAL(value) __literal(SINT,value)
    89 #define __SINT_LITERAL(value) __literal(SINT,value)
    90 #define __INT_LITERAL(value) __literal(INT,value)
    90 #define __INT_LITERAL(value) __literal(INT,value)
    91 #define __DINT_LITERAL(value) __literal(DINT,value,__32b_sufix)
    91 #define __DINT_LITERAL(value) __literal(DINT,value,__32b_sufix)
  1763 static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
  1763 static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
  1764   TEST_EN(BOOL)\
  1764   TEST_EN(BOOL)\
  1765   return __time_cmp(op1, op2) != 0 ? 1 : 0;\
  1765   return __time_cmp(op1, op2) != 0 ? 1 : 0;\
  1766 }
  1766 }
  1767 
  1767 
       
  1768 #define __ne_string(fname, TYPENAME) \
       
  1769 static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
       
  1770   TEST_EN(BOOL)\
       
  1771   return __STR_CMP(op1, op2) != 0 ? 1 : 0;\
       
  1772 }
  1768 
  1773 
  1769 /* Comparison for numerical data types */
  1774 /* Comparison for numerical data types */
  1770 #define __iec_(TYPENAME) \
  1775 #define __iec_(TYPENAME) \
  1771 __ne_num(NE_##TYPENAME, TYPENAME) /* The explicitly typed standard functions */\
  1776 __ne_num(NE_##TYPENAME, TYPENAME) /* The explicitly typed standard functions */\
  1772 __ne_num(NE__BOOL__##TYPENAME##__##TYPENAME, TYPENAME) /* Overloaded function */
  1777 __ne_num(NE__BOOL__##TYPENAME##__##TYPENAME, TYPENAME) /* Overloaded function */
  1781 __ANY_DATE(__iec_)
  1786 __ANY_DATE(__iec_)
  1782 __iec_(TIME)
  1787 __iec_(TIME)
  1783 #undef __iec_
  1788 #undef __iec_
  1784 
  1789 
  1785 /* Comparison for string data types */	
  1790 /* Comparison for string data types */	
  1786 __compare_string(NE_STRING, != ) /* The explicitly typed standard functions */
  1791 __ne_string(NE_STRING, STRING) /* The explicitly typed standard functions */
  1787 __compare_string(NE__BOOL__STRING__STRING, != ) /* Overloaded function */
  1792 __ne_string(NE__BOOL__STRING__STRING, STRING) /* Overloaded function */
  1788 
  1793 
  1789 
  1794 
  1790 
  1795 
  1791 
  1796 
  1792 
  1797