2005-12-29 17:25:28 +00:00
|
|
|
/*
|
|
|
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* Version: MPL 1.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
* Portions created by the Initial Developer are Copyright (C)
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* switch_platform.h -- Platform Specific Header
|
|
|
|
*
|
|
|
|
*/
|
2006-01-02 22:36:01 +00:00
|
|
|
/*! \file switch_platform.h
|
|
|
|
\brief Platform Specific Header
|
2006-01-01 15:23:12 +00:00
|
|
|
*/
|
2005-12-29 17:25:28 +00:00
|
|
|
#ifndef SWITCH_PLATFORM_H
|
|
|
|
#define SWITCH_PLATFORM_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-02-20 00:23:25 +00:00
|
|
|
#ifdef _MSC_VER
|
2006-02-21 17:55:38 +00:00
|
|
|
/* disable the following warnings
|
|
|
|
* C4152: non standard extension, function/data ptr conversion in expression
|
|
|
|
* C4054: A function pointer is cast (possibly incorrectly) to a data pointer.
|
|
|
|
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
|
|
|
* C4142: A type is redefined in a manner that has no effect on the generated code.
|
|
|
|
* C4200: Non standard extension C zero sized array
|
|
|
|
* C4204: nonstandard extension used : non-constant aggregate initializer
|
|
|
|
*/
|
2006-02-20 06:13:56 +00:00
|
|
|
#pragma warning(disable:4152 4054 4100 4142 4200 4204)
|
2006-02-20 00:23:25 +00:00
|
|
|
|
2005-12-29 17:25:28 +00:00
|
|
|
#if (_MSC_VER >= 1400) // VC8+
|
|
|
|
#ifndef _CRT_SECURE_NO_DEPRECATE
|
|
|
|
#define _CRT_SECURE_NO_DEPRECATE
|
|
|
|
#endif
|
|
|
|
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
|
|
|
#define _CRT_NONSTDC_NO_DEPRECATE
|
|
|
|
#endif
|
|
|
|
#endif // VC8+
|
|
|
|
|
2006-02-21 17:55:38 +00:00
|
|
|
#if _MSC_VER < 1300
|
|
|
|
#ifndef __FUNCTION__
|
|
|
|
#define __FUNCTION__ ""
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef uint32_t
|
|
|
|
typedef unsigned __int8 uint8_t;
|
|
|
|
typedef unsigned __int16 uint16_t;
|
|
|
|
typedef unsigned __int32 uint32_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
typedef __int8 int8_t;
|
|
|
|
typedef __int16 int16_t;
|
|
|
|
typedef __int32 int32_t;
|
|
|
|
typedef __int64 int64_t;
|
|
|
|
typedef unsigned long in_addr_t;
|
|
|
|
#endif
|
2006-02-22 23:07:23 +00:00
|
|
|
#define PACKED
|
2006-02-21 17:55:38 +00:00
|
|
|
#else
|
2006-02-22 21:04:53 +00:00
|
|
|
/* packed attribute */
|
|
|
|
#ifndef PACKED
|
2006-02-22 23:07:23 +00:00
|
|
|
#define PACKED __attribute__ ((__packed__))
|
2006-02-22 21:04:53 +00:00
|
|
|
#endif
|
2006-02-21 17:55:38 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#ifndef getpid
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _MSC_VER
|
|
|
|
|
|
|
|
|
2005-12-29 17:25:28 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#if defined(SWITCH_CORE_DECLARE_STATIC)
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_DECLARE(type) type __stdcall
|
|
|
|
#define SWITCH_DECLARE_NONSTD(type) type __cdecl
|
2005-12-29 17:25:28 +00:00
|
|
|
#define SWITCH_DECLARE_DATA
|
|
|
|
#elif defined(FREESWITCHCORE_EXPORTS)
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_DECLARE(type) __declspec(dllexport) type __stdcall
|
|
|
|
#define SWITCH_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
|
|
|
|
#define SWITCH_DECLARE_DATA __declspec(dllexport)
|
2005-12-29 17:25:28 +00:00
|
|
|
#else
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_DECLARE(type) __declspec(dllimport) type __stdcall
|
|
|
|
#define SWITCH_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
|
|
|
|
#define SWITCH_DECLARE_DATA __declspec(dllimport)
|
2005-12-29 17:25:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(SWITCH_MOD_DECLARE_STATIC)
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_MOD_DECLARE(type) type __cdecl
|
2005-12-29 17:25:28 +00:00
|
|
|
#elif defined(MOD_EXPORTS)
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_MOD_DECLARE(type) __declspec(dllexport) type __cdecl
|
2005-12-29 17:25:28 +00:00
|
|
|
#else
|
2005-12-29 19:14:05 +00:00
|
|
|
#define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __cdecl
|
2005-12-29 17:25:28 +00:00
|
|
|
#endif
|
|
|
|
#else //not win32
|
|
|
|
#define SWITCH_DECLARE(type) type
|
|
|
|
#define SWITCH_DECLARE_NONSTD(type) type
|
|
|
|
#define SWITCH_MOD_DECLARE(type) type
|
|
|
|
#define SWITCH_DECLARE_DATA
|
|
|
|
#endif
|
|
|
|
|
2006-01-02 22:36:01 +00:00
|
|
|
#ifdef DOXYGEN
|
|
|
|
#define DoxyDefine(x) x
|
|
|
|
#else
|
|
|
|
#define DoxyDefine(x)
|
|
|
|
#endif
|
|
|
|
|
2005-12-29 17:25:28 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|