00001 /* 00002 * Copyright (C) 2003-2007 Funambol, Inc 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License version 2 as 00006 * published by the Free Software Foundation. 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR 00011 * PURPOSE. See the GNU General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program; if not, write to the Free Software 00015 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00016 * 02111-1307 USA 00017 */ 00018 00019 #ifndef INCL_WIN_ADAPTER 00020 #define INCL_WIN_ADAPTER 00021 00023 #include <stdarg.h> 00024 #include <stdio.h> 00025 00026 00027 #ifdef _WIN32_WCE 00028 #include <winsock.h> 00029 #define __declspec(ignore) 00030 00031 // Map snprintf and vsnprintf to winmobile functions 00032 #define snprintf _snprintf 00033 #define vsnprintf _vsnprintf 00034 00035 // some of the code compares NULL against integers, which 00036 // fails if NULL is defined as (void *)0 00037 #undef NULL 00038 #define NULL 0 00039 #endif // #ifdef _WIN32_WCE 00040 00041 00042 typedef wchar_t WCHAR; 00043 00044 // Define this to the implementation of the sprintf variant with 00045 // size check for wide char. 00046 #define snwprintf _snwprintf 00047 00048 00052 int round(double val); 00053 00054 00055 #if defined(WIN32) && !defined(_WIN32_WCE) 00056 void printMemLeaks(); 00057 #endif 00058 00059 00061 #endif