pputl  0.2.1
pputl Preprocessor Utilities
Macros
eq.h File Reference

PPUTL_EQ - expands to 1 if two numbers a and b [0, 256) are equal, or 0 if not More...

#include "pputl/choose.h"
#include "pputl/gen/repeat.h"

Go to the source code of this file.

Macros

#define PPUTL_EQ(a, b)   PPUTL_DETAIL_EQ_X(a, b)
 
#define PPUTL_DETAIL_EQ_X(a, b)   PPUTL_CHOOSE(a)(PPUTL_DETAIL_EQ_BITS_CHOICE(b)(b))
 
#define PPUTL_DETAIL_EQ_BITS_CHOICE(i)
 
#define PPUTL_DETAIL_EQ_BITS_EQ0(i)   1, PPUTL_GEN_REPEAT(255, 0)
 
#define PPUTL_DETAIL_EQ_BITS_GT0(i)   PPUTL_GEN_REPEAT(i, 0), 1, PPUTL_GEN_REPEAT(254, 0)
 

Detailed Description

PPUTL_EQ - expands to 1 if two numbers a and b [0, 256) are equal, or 0 if not

Macro Definition Documentation

◆ PPUTL_DETAIL_EQ_BITS_CHOICE

#define PPUTL_DETAIL_EQ_BITS_CHOICE (   i)
Value:
(PPUTL_DETAIL_EQ_BITS_EQ0, PPUTL_GEN_REPEAT(255, PPUTL_DETAIL_EQ_BITS_GT0))
PPUTL_CHOOSE
#define PPUTL_CHOOSE(idx)
Definition: choose.h:47
PPUTL_GEN_REPEAT
#define PPUTL_GEN_REPEAT(n,...)
Definition: repeat.h:43