00001 /* 00002 * 00003 * $Id: cmpios.h,v 1.4 2009/02/28 03:18:22 tyreld Exp $ 00004 * 00005 * (C) Copyright IBM Corp. 2003, 2005, 2006, 2008 00006 * 00007 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE 00008 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE 00009 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. 00010 * 00011 * You can obtain a current copy of the Eclipse Public License from 00012 * http://www.opensource.org/licenses/eclipse-1.0.txt 00013 * 00014 * Author: Adrian Schuur <schuur@de.ibm.com> 00015 * Contributors: 00016 * 00017 * Description: CMPI OS Specific Definions 00018 * 00019 */ 00020 00021 /* ------------------------------------------------------------------------- */ 00022 /* */ 00023 /* Copyright (c) 2006 The Open Group */ 00024 /* */ 00025 /* Permission is hereby granted, free of charge, to any person obtaining a */ 00026 /* copy of this software (the "Software"), to deal in the Software without */ 00027 /* restriction, including without limitation the rights to use, copy, */ 00028 /* modify, merge, publish, distribute, sublicense, and/or sell copies of */ 00029 /* the Software, and to permit persons to whom the Software is furnished */ 00030 /* to do so, subject to the following conditions: */ 00031 /* */ 00032 /* The above copyright notice and this permission notice shall be included */ 00033 /* in all copies or substantial portions of the Software. */ 00034 /* */ 00035 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */ 00036 /* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ 00037 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ 00038 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ 00039 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT */ 00040 /* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR */ 00041 /* THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 00042 /* */ 00043 /* ------------------------------------------------------------------------- */ 00044 00045 #ifndef _CMPIOS_H_ 00046 # define _CMPIOS_H_ 00047 00048 # include "cmpipl.h" 00049 # include <stdlib.h> // To get the size_t 00050 # define CMPI_THREAD_RETURN void* 00051 # define CMPI_THREAD_TYPE void* 00052 # define CMPI_MUTEX_TYPE void* 00053 # define CMPI_COND_TYPE void* 00054 00055 # if defined(CMPI_PLATFORM_WIN32_IX86_MSVC) 00056 # define CMPI_THREAD_CDECL __stdcall 00057 # define CMPI_THREAD_KEY_TYPE unsigned long int 00058 00059 # ifndef HAVE_STRUCT_TIMESPEC 00060 # define HAVE_STRUCT_TIMESPEC 00061 struct timespec 00062 { 00063 long tv_sec; 00064 long tv_nsec; 00065 }; 00066 # endif /* HAVE_STRUCT_TIMESPEC */ 00067 00068 # elif defined(CMPI_PLATFORM_ZOS_ZSERIES_IBM) 00069 # ifndef __cplusplus 00070 # include <pthread.h> 00071 # define CMPI_THREAD_CDECL 00072 # else 00073 # define CMPI_THREAD_CDECL __cdecl 00074 # endif 00075 # define CMPI_THREAD_KEY_TYPE pthread_key_t 00076 # else 00077 # define CMPI_THREAD_CDECL 00078 # define CMPI_THREAD_KEY_TYPE unsigned long int 00079 # endif 00080 00081 /* Define CMPI_EXPORT */ 00082 # if defined(CMPI_PLATFORM_WIN32_IX86_MSVC) 00083 # define CMPI_EXPORT __declspec(dllexport) 00084 # elif defined(CMPI_PLATFORM_LINUX_GENERIC_GNU) && (__GNUC__ >= 4) 00085 # define CMPI_EXPORT __attribute__((visibility("default"))) 00086 # else 00087 # define CMPI_EXPORT /* empty */ 00088 # endif 00089 00090 /* Define CMPI_EXTERN_C */ 00091 # ifdef __cplusplus 00092 # define CMPI_EXTERN_C extern "C" CMPI_EXPORT 00093 # else 00094 # define CMPI_EXTERN_C CMPI_EXPORT 00095 # endif 00096 00097 #endif