mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
add for unix port
This commit is contained in:
parent
bd36f714d2
commit
b2ff538258
1 changed files with 33 additions and 0 deletions
33
src/lib9/fmt/plan9.h
Normal file
33
src/lib9/fmt/plan9.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* compiler directive on Plan 9
|
||||
*/
|
||||
#ifndef USED
|
||||
#define USED(x) if(x);else
|
||||
#endif
|
||||
|
||||
/*
|
||||
* easiest way to make sure these are defined
|
||||
*/
|
||||
#define uchar _fmtuchar
|
||||
#define ushort _fmtushort
|
||||
#define uint _fmtuint
|
||||
#define ulong _fmtulong
|
||||
#define vlong _fmtvlong
|
||||
#define uvlong _fmtuvlong
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned long long uvlong;
|
||||
typedef long long vlong;
|
||||
|
||||
/*
|
||||
* nil cannot be ((void*)0) on ANSI C,
|
||||
* because it is used for function pointers
|
||||
*/
|
||||
#undef nil
|
||||
#define nil 0
|
||||
|
||||
#undef nelem
|
||||
#define nelem(x) (sizeof (x)/sizeof (x)[0])
|
||||
|
Loading…
Reference in a new issue