diff options
Diffstat (limited to 'sesman/chansrv/chansrv.h')
-rw-r--r-- | sesman/chansrv/chansrv.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h index 7a84ec94..a7a0f3e7 100644 --- a/sesman/chansrv/chansrv.h +++ b/sesman/chansrv/chansrv.h @@ -54,4 +54,23 @@ main_cleanup(void); #define LOGM(_args) #endif +#ifndef GSET_UINT8 +#define GSET_UINT8(_ptr, _offset, _data) \ + *((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))) = (unsigned char)(_data) +#define GGET_UINT8(_ptr, _offset) \ + (*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset)))) +#define GSET_UINT16(_ptr, _offset, _data) \ + GSET_UINT8(_ptr, _offset, _data); \ + GSET_UINT8(_ptr, (_offset) + 1, (_data) >> 8) +#define GGET_UINT16(_ptr, _offset) \ + (GGET_UINT8(_ptr, _offset)) | \ + ((GGET_UINT8(_ptr, (_offset) + 1)) << 8) +#define GSET_UINT32(_ptr, _offset, _data) \ + GSET_UINT16(_ptr, _offset, _data); \ + GSET_UINT16(_ptr, (_offset) + 2, (_data) >> 16) +#define GGET_UINT32(_ptr, _offset) \ + (GGET_UINT16(_ptr, _offset)) | \ + ((GGET_UINT16(_ptr, (_offset) + 2)) << 16) +#endif + #endif |