/*===========================================================================
                    IMPORTANT NOTICE

                  OEM DISTRIBUTION ONLY

FILE:  OEMStdLib.h

SERVICES:  OEM C Standard Library Interface

GENERAL DESCRIPTION:
	Definitions for OEM C Standard Library Calls

        Copyright © 1999-2002 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
===========================================================================*/

#ifndef OEMSTDLIB_H
#define OEMSTDLIB_H

// <math.h> needs to be here because, the one shipped with MSVC has a conditional 
// C++ template in it (for pow) and moving it in "extern 'C'" block causes :-
// error C2894: templates cannot be declared to have 'C' linkage

#include <math.h>

#if defined(__cplusplus)
extern "C" {
#endif

/**************************************************************************/
/*               C STANDARD LIBRARY EXPORTED OPERATIONS                     */
/**************************************************************************/

#include <errno.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <float.h>

#define OEM_jmpbuf                   jmp_buf
#define OEM_longjmp(jp,ret)          longjmp((jp),(ret))
#define OEM_setjmp(jp)               setjmp((jp))
#define OEM_DateTime                 struct tm

#define OEM_atof(s)                  atof((s))
#define OEM_atoi(s)                  atoi((s))
#define OEM_memchr(s,c,size)         memchr((s),(c),(size))
#define OEM_memcmp(a,b,size)         memcmp((a),(b),(size))
#define OEM_memmove(dest,src,size)   memmove((dest),(src),(size))
#define OEM_memset(dest,ch,size)     memset((dest),(ch),(size))
#define OEM_qsort(b,n,s,pfn)         qsort((b),(n),(s),(pfn))
#define OEM_strcat(dest,src)         strcat((dest),(src))
#define OEM_strchr(s1,ch)            strchr((s1),(ch))
#define OEM_strcmp(s1,s2)            strcmp((s1),(s2))
#define OEM_strcpy(dest,src)         strcpy((dest),(src))
#define OEM_strlen(s1)               strlen((s1))
#define OEM_strncmp(a,b,count)       strncmp((a),(b),(count))
#define OEM_strncpy(dest,src,count)  strncpy((dest),(src),(count))
#define OEM_strrchr(s1,ch)           strrchr((s1),(ch))
#define OEM_strstr(h,n)              strstr((h),(n))
#define OEM_strtoul(s1,s2,n)         strtoul((s1),(s2),(n))


#if defined(__cplusplus)
}
#endif


#endif /* OEMSTDLIB_H */
