Jump to content

Parallel Algorithms: Difference between revisions

Line 725: Line 725:
I never figured out how to use standard c headers.
I never figured out how to use standard c headers.


XMT only has int (32 bit) and float (32 bit). If you need a bool type, you will need to define it in a header.
* XMT only has int (32 bit) and float (32 bit). If you need a bool type, you will need to define it in a header.
* You cannot call functions from within <code>spawn</code>
 
Here is my helpers header <code>helpers.h</code>
Here is my helpers header <code>helpers.h</code>
{{ hidden | <code>helpers.h</code> |
{{ hidden | <code>helpers.h</code> |
Line 735: Line 737:
#define false 0
#define false 0
#define bool int
#define bool int
// #define NIL -1


int max(int a, int b) {
#define max(a, b) ((((a) < (b)) ? (b) : (a)))
  return a < b ? b : a;
#define min(a, b) ((((a) < (b)) ? (a) : (b)))
}
 
int min(int a, int b) {
  return a < b ? a : b;
}


#endif
#endif