cmpi
cmpios.h
Go to the documentation of this file.
1 /*
2  *
3  * $Id: cmpios.h,v 1.5 2011/05/18 03:47:04 tyreld Exp $
4  *
5  * (C) Copyright IBM Corp. 2003, 2005, 2006, 2008
6  *
7  * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
8  * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
9  * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
10  *
11  * You can obtain a current copy of the Eclipse Public License from
12  * http://www.opensource.org/licenses/eclipse-1.0.txt
13  *
14  * Author: Adrian Schuur <schuur@de.ibm.com>
15  * Contributors:
16  *
17  * Description: CMPI OS Specific Definions
18  *
19  */
20 
21 /* ------------------------------------------------------------------------- */
22 /* */
23 /* Copyright (c) 2006 The Open Group */
24 /* */
25 /* Permission is hereby granted, free of charge, to any person obtaining a */
26 /* copy of this software (the "Software"), to deal in the Software without */
27 /* restriction, including without limitation the rights to use, copy, */
28 /* modify, merge, publish, distribute, sublicense, and/or sell copies of */
29 /* the Software, and to permit persons to whom the Software is furnished */
30 /* to do so, subject to the following conditions: */
31 /* */
32 /* The above copyright notice and this permission notice shall be included */
33 /* in all copies or substantial portions of the Software. */
34 /* */
35 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */
36 /* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
37 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
38 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
39 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT */
40 /* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR */
41 /* THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
42 /* */
43 /* ------------------------------------------------------------------------- */
44 
45 #ifndef _CMPIOS_H_
46 # define _CMPIOS_H_
47 
48 # include "cmpipl.h"
49 # include <stdlib.h> // To get the size_t
50 # define CMPI_THREAD_RETURN void*
51 # define CMPI_THREAD_TYPE void*
52 # define CMPI_MUTEX_TYPE void*
53 # define CMPI_COND_TYPE void*
54 
55 # if defined(CMPI_PLATFORM_WIN32_IX86_MSVC)
56 # define CMPI_THREAD_CDECL __stdcall
57 # define CMPI_THREAD_KEY_TYPE unsigned long int
58 
59 # ifndef HAVE_STRUCT_TIMESPEC
60 # define HAVE_STRUCT_TIMESPEC
61  struct timespec
62  {
63  long tv_sec;
64  long tv_nsec;
65  };
66 # endif /* HAVE_STRUCT_TIMESPEC */
67 
68 # elif defined(CMPI_PLATFORM_ZOS_ZSERIES_IBM)
69 # ifndef __cplusplus
70 # include <pthread.h>
71 # define CMPI_THREAD_CDECL
72 # else
73 # define CMPI_THREAD_CDECL __cdecl
74 # endif
75 # define CMPI_THREAD_KEY_TYPE pthread_key_t
76 # elif defined(CMPI_PLATFORM_LINUX_GENERIC_GNU)
77 # include <pthread.h>
78 # define CMPI_THREAD_CDECL
79 # define CMPI_THREAD_KEY_TYPE pthread_key_t
80 # else
81 # define CMPI_THREAD_CDECL
82 # define CMPI_THREAD_KEY_TYPE unsigned long int
83 # endif
84 
85 /* Define CMPI_EXPORT */
86 # if defined(CMPI_PLATFORM_WIN32_IX86_MSVC)
87 # define CMPI_EXPORT __declspec(dllexport)
88 # elif defined(CMPI_PLATFORM_LINUX_GENERIC_GNU) && (__GNUC__ >= 4)
89 # define CMPI_EXPORT __attribute__((visibility("default")))
90 # else
91 # define CMPI_EXPORT /* empty */
92 # endif
93 
94 /* Define CMPI_EXTERN_C */
95 # ifdef __cplusplus
96 # define CMPI_EXTERN_C extern "C" CMPI_EXPORT
97 # else
98 # define CMPI_EXTERN_C CMPI_EXPORT
99 # endif
100 
101 #endif