Unicode compilation issues and fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Michele, I just fixed this in http://trac.pjsip.org/repos/ticket/989

Cheers,
  Benny

On Tue, Sep 22, 2009 at 8:12 PM, Michele Cicciotti <
m.cicciotti at khamsalabs.net> wrote:

>  I've noticed that PJSIP 1.4 compiles fine as an Unicode application under
> Windows, save for portaudio (but the issues seem to be mostly cosmetic
> anyway) and a few issues in PJSIP itself. I attached a patch with my PJSIP
> fixes; I doubt I need to sign a submission agreement for such trivial fixes,
> but I have no problem signing one. An explaination of the fixes:
>
>    - set PJ_NATIVE_STRING_IS_UNICODE to 1 if UNICODE is defined, which
>    takes care of most issues
>    - GetProcAddress always takes a char *, even if UNICODE is defined, so
>    use char * instead of pj_char_t * (and accordingly omit PJ_T on string
>    literals)
>
> --
>
>   [image: KHAMSA SA]
>
> Michele Cicciotti
> Research & Development
>
> Mobile:   + 39 339 3206609
> E-mail:    m.cicciotti at khamsalabs.net
>
> KHAMSA SA
>  Via Giacometti 1 - 6900 Lugano - Switzerland
> Web:   www.khamsa.net
>
> Technical Support CH:  + 41 (0)91 2206457
> Technical Support IT:   + 39 02 911930891
> E-mail:  support at khamsa.ch
>
> Monday to Friday 10.00 - 12.00 and 14.00 - 16.00
>
>
> ..........................................................................................................................................................................................
>
> This e-mail (including attachments) is intended only for the recipient(s)
> named above. It may contain confidential or privileged
> information and should not be read, copied or otherwise used by any other
> person.
> If you are not the named recipient, please contact us immediately and
> delete the e-mail from your system.
>
> Le informazioni contenute in questo messaggio sono riservate e
> confidenziali ed ? vietata la diffusione in qualunque modo
> eseguita. Qualora Lei non fosse la persona a cui il presente messaggio ?
> destinato, La invitiamo ad eliminarlo e a non leggerlo,
> dandocene gentilmente comunicazione.
>
>
>
> Index: pjlib/include/pj/compat/os_win32.h
> ===================================================================
> @@ -110,11 +110,7 @@
>  #ifndef PJ_OS_HAS_CHECK_STACK
>  #   define PJ_OS_HAS_CHECK_STACK       1
>  #endif
> +#ifdef UNICODE
> +#define PJ_NATIVE_STRING_IS_UNICODE    1
> +#else
>  #define PJ_NATIVE_STRING_IS_UNICODE    0
> +#endif
>
>  #define PJ_ATOMIC_VALUE_TYPE           long
>
> Index: pjlib/src/pj/ip_helper_win32.c
> ===================================================================
> @@ -77,7 +77,7 @@
>  #endif
>  }
>
> -static FARPROC GetIpHlpApiProc(pj_char_t *lpProcName)
> +static FARPROC GetIpHlpApiProc(char *lpProcName)
>  {
>     if(NULL == s_hDLL) {
>        s_hDLL = LoadLibrary(PJ_T("IpHlpApi"));
> @@ -98,7 +98,7 @@
>  {
>     if(NULL == s_pfnGetIpAddrTable) {
>        s_pfnGetIpAddrTable = (PFN_GetIpAddrTable)
> -           GetIpHlpApiProc(PJ_T("GetIpAddrTable"));
> +           GetIpHlpApiProc("GetIpAddrTable");
>     }
>
>     if(NULL != s_pfnGetIpAddrTable) {
> @@ -117,7 +117,7 @@
>  {
>     if(NULL == s_pfnGetAdapterAddresses) {
>        s_pfnGetAdapterAddresses = (PFN_GetAdapterAddresses)
> -           GetIpHlpApiProc(PJ_T("GetAdapterAddresses"));
> +           GetIpHlpApiProc("GetAdapterAddresses");
>     }
>
>     if(NULL != s_pfnGetAdapterAddresses) {
> @@ -134,7 +134,7 @@
>  {
>     if(NULL == s_pfnGetIfEntry) {
>        s_pfnGetIfEntry = (PFN_GetIfEntry)
> -           GetIpHlpApiProc(PJ_T("GetIfEntry"));
> +           GetIpHlpApiProc("GetIfEntry");
>     }
>
>     if(NULL != s_pfnGetIfEntry) {
> @@ -152,7 +152,7 @@
>  {
>     if(NULL == s_pfnGetIpForwardTable) {
>        s_pfnGetIpForwardTable = (PFN_GetIpForwardTable)
> -           GetIpHlpApiProc(PJ_T("GetIpForwardTable"));
> +           GetIpHlpApiProc("GetIpForwardTable");
>     }
>
>     if(NULL != s_pfnGetIpForwardTable) {
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20091110/2050191f/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux