example_main.h
Go to the documentation of this file.
00001 /*
00002  *                         OpenSplice DDS
00003  *
00004  *   This software and documentation are Copyright 2006 to 2013 PrismTech
00005  *   Limited and its licensees. All rights reserved. See file:
00006  *
00007  *                     $OSPL_HOME/LICENSE
00008  *
00009  *   for full copyright notice and license terms.
00010  *
00011  */
00012 
00013 #ifndef OSPL_MAIN
00014 #define OSPL_MAIN main
00015 #ifdef WINCE
00016 #include "os_stdlib.h"
00017 int main (int argc, char* argv[]);
00018 int WINAPI WinMain
00019     (HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
00020 {
00021     int argc;
00022     char *argv[256];
00023     argc = os_mainparams (lpCmdLine, argv);
00024     return main (argc, argv);
00025 }
00026 #endif /* WINCE */
00027 #endif /* ! OSPL_MAIN */
00028 
00029 #ifdef WINCE
00030 #ifdef __cplusplus
00031 /* The WinCE coredll.lib/dll doesn't have symbols for ostream operator << for
00032 non string/char types. These examples use std::cout/cerr with all sorts so
00033 without the below you would need to link/load onto the target the MSVCRT lib/dlls
00034 to run them.
00035 If you are already already loading these extra libraries then you may wish to
00036 define the below to remove this workaround instead... */
00037 #ifndef OSPL_WINCE_HAS_MSVCRT
00038 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int my_int)
00039 {
00040     char my_buffer[23];
00041     _itoa(my_int, my_buffer, 10);
00042     return *this << my_buffer;
00043 }
00044 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned int my_int)
00045 {
00046     char my_buffer[23];
00047     _itoa(my_int, my_buffer, 10);
00048     return *this << my_buffer;
00049 }
00050 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(long my_long)
00051 {
00052     char my_buffer[23];
00053     _itoa(my_long, my_buffer, 10);
00054     return *this << my_buffer;
00055 }
00056 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned long my_long)
00057 {
00058     char my_buffer[23];
00059     _itoa(my_long, my_buffer, 10);
00060     return *this << my_buffer;
00061 }
00062 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(float my_float)
00063 {
00064     char my_buffer[23];
00065     sprintf(my_buffer, "%f", my_float);
00066     return *this << my_buffer;
00067 }
00068 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(const void* my_pointer)
00069 {
00070     char my_buffer[23];
00071     sprintf(my_buffer, "%p", my_pointer);
00072     return *this << my_buffer;
00073 }
00074 std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(bool my_bool)
00075 {
00076     return *this << (my_bool ? "true" : "false");
00077 }
00078 #endif /* ! OSPL_WINCE_HAS_MSVCRT */
00079 #endif /* __cplusplus */
00080 #endif /* WINCE */


opensplice_dds_broker
Author(s):
autogenerated on Thu Jun 6 2019 18:52:31