src/include/common/base/fscapi.h

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
00034  */
00035 
00044 #ifndef INCL_FSCAPI
00045     #define INCL_FSCAPI
00046 
00048     /* Autodetect target system based on compiler automatic macros */
00049     #if defined(__unix__) || defined(__linux__)
00050     /* This is a generic unix system */
00051     #define POSIX 1
00052     #elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
00053     /* This is an iPhone */
00054     #define MAC   1
00055     #define POSIX 1
00056     #elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
00057     /* This is a Mac */
00058     #define MAC   1
00059     #define POSIX 1
00060     #elif defined(_WIN32_WCE) || defined(WIN32)
00061     /* This is windows or windows mobile, in this case we don't have our
00062      * own macro so there is nothing we need to do
00063      */
00064     #elif defined(__SYMBIAN32__)
00065     /* This is Symbian. Other macros allow to discriminate the version, but at
00066      * the moment we don't need it
00067      */
00068     #define SYMBIAN 1
00069     #else
00070     #error "Unrecognized platform, cannot proceed"
00071     #endif
00072 
00073     /* Include the proper files */
00074     #ifdef MAC
00075         #ifndef MSG_NOSIGNAL
00076             #define MSG_NOSIGNAL SO_NOSIGPIPE
00077         #endif
00078     #endif
00079     
00080     #ifdef POSIX
00081         #include "base/posixadapter.h"
00082     #elif SYMBIAN
00083         #include "base/symbianadapter.h"
00084     #elif defined(_WIN32_WCE) || defined(WIN32)
00085         // Windows common stuff
00086         #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
00087 
00088         #include <windows.h>
00089         #include "base/winadapter.h"
00090 
00091         #if defined(WIN32)
00092             #include "wininet.h"
00093         #endif
00094 
00095         #if defined(WIN32) && !defined(_WIN32_WCE)
00096             #include <sys/stat.h>
00097             #include "shlobj.h"        
00098             #include <wchar.h>
00099             #include <time.h>
00100             #include <stdlib.h>
00101         #endif
00102 
00103         #ifdef _WIN32_WCE
00104             #include "base/time.h"
00105         #endif
00106     #endif
00107 
00108     #ifdef MALLOC_DEBUG
00109       #pragma warning(disable:4291)
00110       extern size_t dbgcounter;
00111       void *operator new(size_t s);
00112       void *operator new[](size_t s);
00113       void *operator new(size_t s, char* file, int line);
00114       void *operator new[](size_t s, char* file, int line);
00115       void operator delete(void* p);
00116       void operator delete[] (void* p);
00117 
00118       #define new new(__FILE__, __LINE__)
00119     #endif
00120 
00121     #ifndef SYNC4J_LINEBREAK
00122     // default encoding of line break in native strings,
00123     // may be overridden by adapter header files above
00124     # define SYNC4J_LINEBREAK TEXT("\r\n")
00125     #endif
00126 
00127     #ifndef WCHAR_PRINTF
00128 
00129     # define WCHAR_PRINTF "ls"
00130     #endif
00131 
00132     #if !defined(PLATFORM_VA_LIST)
00133     #define PLATFORM_VA_LIST va_list
00134     #endif
00135 
00136     #if !defined(PLATFORM_VA_START)
00137     #define PLATFORM_VA_START va_start
00138     #endif
00139 
00140     #if !defined(PLATFORM_VA_END)
00141     #define PLATFORM_VA_END  va_end
00142     #endif
00143 
00144     #if !defined(PLATFORM_VA_COPY)
00145     #define PLATFORM_VA_COPY va_copy
00146     #endif
00147 
00148     #if !defined(PLATFORM_VA_ARG)
00149     #define PLATFORM_VA_ARG va_arg
00150     #endif
00151 
00152 
00169     #include <assert.h>
00170 
00171     #ifdef HAVE_STDARG_H
00172         #include <stdarg.h>
00173     #endif
00174  
00175     #include "base/errors.h"
00176 
00178 #endif
00179 
00180 

Generated on Tue Jun 10 17:20:21 2008 for Funambol C++ Client Library by  doxygen 1.5.2