This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the smiley program demonstrated by Russ Cox at http://research.swtch.com/acme | |
// it shows that the plan9 compiler http://plan9.bell-labs.com/sys/doc/comp.html fully supports UTF-8 | |
// i tried to compile it with a recent version of the plan9 compiler running on vmware but it failed. | |
// it seems that older versions of the compiler supported sizeof(void) == 0 | |
// anyway you get the idea | |
#include <u.h> | |
#include <libc.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define CONFIG_FOO 1 | |
#define CONFIG_NOO 0 | |
#define is_set(macro) is_set_(macro) | |
#define macrotest_1 , | |
#define is_set_(value) is_set__(macrotest_##value) | |
#define is_set__(comma) is_set___(comma 1, 0) | |
#define is_set___(_, v, ...) v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// A template for a dynamically reallocated bitmap of unsigned values, each | |
// the given number of bits long. An array of bit(s)-sized elements. | |
// The remainder of division of sizeof(unsigned) by elem_size must be 0 (to | |
// simplify code and avoid operations on split elements of bitarray::bits). | |
// The place of bits pointer is reused to minimize initial allocations. | |
// | |
#ifndef _BITARRAY_HPP_ | |
#define _BITARRAY_HPP_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* bitmaps and bitmap operations */ | |
#ifndef _BITMAPS_H_ | |
#define _BITMAPS_H_ | |
/* | |
* Bitmaps are arrays of unsigned ints, filled with bits in most- | |
* significant-first order. So bitmap[0] shall contain the bits from | |
* 0 to 31 on a 32bit architecture, bitmap[1] - 32-63, and so forth. | |
* | |
* The callers are responsible to do all the bounds-checking. |