Xfuncs.h
上传用户:lctgjx
上传日期:2022-06-04
资源大小:8887k
文件大小:3k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /*
  2.  * $XdotOrg: xc/include/Xfuncs.h,v 1.2 2004/04/23 18:43:05 eich Exp $
  3.  * $Xorg: Xfuncs.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
  4.  * 
  5.  * 
  6. Copyright 1990, 1998  The Open Group
  7. Permission to use, copy, modify, distribute, and sell this software and its
  8. documentation for any purpose is hereby granted without fee, provided that
  9. the above copyright notice appear in all copies and that both that
  10. copyright notice and this permission notice appear in supporting
  11. documentation.
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  17. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  18. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. Except as contained in this notice, the name of The Open Group shall not be
  21. used in advertising or otherwise to promote the sale, use or other dealings
  22. in this Software without prior written authorization from The Open Group.
  23.  *
  24.  */
  25. /* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */
  26. #ifndef _XFUNCS_H_
  27. #define _XFUNCS_H_
  28. #include <X11/Xosdefs.h>
  29. /* the old Xfuncs.h, for pre-R6 */
  30. #if !(defined(XFree86LOADER) && defined(IN_MODULE))
  31. #ifdef X_USEBFUNCS
  32. void bcopy();
  33. void bzero();
  34. int bcmp();
  35. #else
  36. #if defined(SYSV) && !defined(__SCO__) && !defined(sun) && !defined(__UNIXWARE__)
  37. #include <memory.h>
  38. void bcopy();
  39. #define bzero(b,len) memset(b, 0, len)
  40. #define bcmp(b1,b2,len) memcmp(b1, b2, len)
  41. #else
  42. #include <string.h>
  43. #if defined(__SCO__) || defined(sun) || defined(__UNIXWARE__)
  44. #include <strings.h>
  45. #endif
  46. #define _XFUNCS_H_INCLUDED_STRING_H
  47. #if defined(sun)
  48. #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
  49. #define bzero(b,len) memset(b, 0, (size_t)(len))
  50. #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
  51. #endif
  52. #endif
  53. #endif /* X_USEBFUNCS */
  54. /* the new Xfuncs.h */
  55. #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
  56. /* the ANSI C way */
  57. #ifndef _XFUNCS_H_INCLUDED_STRING_H
  58. #include <string.h>
  59. #endif
  60. #undef bzero
  61. #define bzero(b,len) memset(b,0,len)
  62. #else /* else X_NOT_STDC_ENV or SunOS 4 */
  63. #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
  64. #include <memory.h>
  65. #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
  66. #if defined(SYSV) && defined(_XBCOPYFUNC)
  67. #undef memmove
  68. #define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
  69. #define _XNEEDBCOPYFUNC
  70. #endif
  71. #else /* else vanilla BSD */
  72. #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
  73. #define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
  74. #define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
  75. #endif /* SYSV else */
  76. #endif /* ! X_NOT_STDC_ENV else */
  77. #if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4))
  78. #define atexit(f) on_exit(f, 0)
  79. #endif
  80. #if defined WIN32 && defined __MINGW32__
  81. #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
  82. #endif
  83. #endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
  84. #endif /* _XFUNCS_H_ */