⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wydefs.h

📁 一个不错
💻 H
字号:
/* Copyright is licensed under GNU LGPL                       by I.J.Wang 2003 WyDefs defines symbols/types/macros for libwy classes. Compiler option summary (if defined):   WYLIB_CONFIG_THROWSPC ... Use throw specification   WYLIB_CONFIG_NORSLI   ... Disable use of SLI   WY_NOEXITMSG        ... WY_TERMINATE sends msg   WY_DEBUG      .... generated debug version   WY_SHORT_SLI  .... Short SLI message*/#ifndef WYDEFS_H__#define WYDEFS_H__#include <cerrno>      // library-wise#include <unistd.h>    // for std::terminate#include <climits>#ifdef WYLIB_SOURCE #if _POSIX_VERSION<199506L #error No Support For POSIX1003.1c     // thread support is required #endif #ifndef _POSIX_VERSION #error No POSIX Support #endif #ifndef _POSIX_SOURCE #define _POSIX_SOURCE #endif #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 199309 #endif#endif// Throw specification by default is empty, unless// WYLIB_CONFIG_THROWSPC is defined//// Note: gcc has an option -fno-enforce-eh-specs (don't check for//       violation of throw specification)//#ifdef WYLIB_CONFIG_THROWSPC #define WY__TSPC(x) throw(x)#else #define WY__TSPC(x)#endif// This symbol is for documentation (must be empty and internal)//#define WY__NOTHROW__//#define WY__NOTHROW__ throw()       // for test// libwy version number//#define WYLIB_VERSION 31// Object signature of libwy is defined here.// Object that concerns being accessed after destroyed should have an signature.//// The format of ID=0x0RSTRST0, where 'R' 'S' 'T' is a hexidecimal digit 0-f.//#include <signal.h>   // for sig_atomic_tconst sig_atomic_t WY_NONE_ID=0xfaad321f;     //  Not an libwy obj IDconst sig_atomic_t WYMUTEX_ID=0x08208200;     //  for WyMutex objectconst sig_atomic_t WYCOND_ID =0x08308300;     //  for WyCond object// wrd(..) functions should not return string with size greater than// this number. this is for removal of failure condition.// const size_t WY_WHAT_IS_MAX_SIZE=1024;#include "wy__base.h"// Terminate with cstr message, file/line info are added//// WY_NOEXITMSG is a compiler option//#ifdef WY_NOEXITMSG#define WY_TERMINATE(cstr) Wy__Base::terminate()#else#define WY_TERMINATE(cstr) Wy__Base::put_abnmsg(cstr,__FILE__,__LINE__),\                      Wy__Base::terminate()#endif#ifdef WY_DEBUG  #define WY_ASSERT(expr)  if(expr) {} else {\                          Wy__Base::put_abnmsg(#expr,__FILE__,__LINE__);\                      Wy__Base::terminate(); }#else #define WY_ASSERT(expr) ((void)0)#endiftypedef int Wy__TypeFD;             // file descriptor typeconst Wy__TypeFD WY__DEFAULT_FD=-1; // default file descriptor#define WY_CONST_GIGA 1000000000    // 1x10^9const size_t Wy__MaxStrSize=(SSIZE_MAX/2)-1;  // max size data size of WyStr// specify system cancel point//#define WY__CANCEL_POINT  (void)0namespace Wy {  enum ByMove_t { ByMove };         // Move constructor signature};#ifdef NDEBUG #define WY_NDEBUG_MSG(r)#else #define WY_NDEBUG_MSG(r) Wy__Base::put_abnmsg((r)->c_repstr(),__FILE__,__LINE__)#endif#include <cstddef>       // for NULL#endif // End WYDEFS_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -