Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

stephan.bergmann
[hidden email] wrote:

> User: vg      
> Date: 2007-09-20 15:08:12+0000
> Modified:
>    porting/sal/inc/sal/main.h
>
> Log:
>  INTEGRATION: CWS os2port01 (1.6.64); FILE MERGED
>  2007/08/09 08:53:36 obr 1.6.64.3: RESYNC: (1.6-1.7); FILE MERGED
>  2007/01/02 17:39:38 ydario 1.6.64.2: Removed wrong code, left here by accident.
>  2006/11/29 14:26:31 ydario 1.6.64.1: Initial OS/2 import.
>
> File Changes:
>
> Directory: /porting/sal/inc/sal/
> ================================
>
> File [changed]: main.h
> Url: http://porting.openoffice.org/source/browse/porting/sal/inc/sal/main.h?r1=1.7&r2=1.8
> Delta lines:  +22 -0
> --------------------
> --- main.h 2006-12-01 17:24:31+0000 1.7
> +++ main.h 2007-09-20 15:08:10+0000 1.8
> @@ -108,6 +108,28 @@
>  }
>  
>  #else /* ! SAL_W32 */
> +
> +#ifdef SAL_OS2
> +
> +int SAL_CALL osl_ProcessHook( int (*sal_main)( int, char**), int argc, char ** argv);
> +
> +#define SAL_DEFINE_CRT_ENTRY() \
> +int main(int argc, char ** argv) \
> +{ \
> +   return osl_ProcessHook(sal_main, argc, argv); \
> +} \
> +
> +#else /* ! SAL_OS2 */
> +
> +#define SAL_DEFINE_CRT_ENTRY() \
> +int main(int argc, char ** argv) \
> +{ \
> + osl_setCommandArgs(argc, argv); \
> + return sal_main(argc, argv); \
> +} \

SAL_DEFINE_CRT_ENTRY had been removed from main.h:1.7, so it looks
dubious that 1.8 re-introduces it for !(defined SAL_W32 || defined SAL_OS2).

-Stephan

> +
> +#endif /* ! SAL_OS2 */
> +
>  # define SAL_WIN_WinMain
>  
>  #endif /* ! SAL_W32 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

Yuri Dario
Hi Stephan,

>SAL_DEFINE_CRT_ENTRY had been removed from main.h:1.7, so it looks
>dubious that 1.8 re-introduces it for !(defined SAL_W32 || defined SAL_OS2).

if this macro is no longer necessary, it may be removed safely.

thanks,


Bye,

        Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/yuri
 * http://www.teamos2.it
 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

stephan.bergmann
In reply to this post by stephan.bergmann
Stephan Bergmann wrote:

> [hidden email] wrote:
>> User: vg      Date: 2007-09-20 15:08:12+0000
>> Modified:
>>    porting/sal/inc/sal/main.h
>>
>> Log:
>>  INTEGRATION: CWS os2port01 (1.6.64); FILE MERGED
>>  2007/08/09 08:53:36 obr 1.6.64.3: RESYNC: (1.6-1.7); FILE MERGED
>>  2007/01/02 17:39:38 ydario 1.6.64.2: Removed wrong code, left here by
>> accident.
>>  2006/11/29 14:26:31 ydario 1.6.64.1: Initial OS/2 import.
>>
>> File Changes:
>>
>> Directory: /porting/sal/inc/sal/
>> ================================
>>
>> File [changed]: main.h
>> Url:
>> http://porting.openoffice.org/source/browse/porting/sal/inc/sal/main.h?r1=1.7&r2=1.8 
>>
>> Delta lines:  +22 -0
>> --------------------
>> --- main.h    2006-12-01 17:24:31+0000    1.7
>> +++ main.h    2007-09-20 15:08:10+0000    1.8
>> @@ -108,6 +108,28 @@
>>  }
>>  
>>  #else    /* ! SAL_W32 */
>> +
>> +#ifdef SAL_OS2
>> +
>> +int SAL_CALL osl_ProcessHook( int (*sal_main)( int, char**), int
>> argc, char ** argv);
>> +
>> +#define SAL_DEFINE_CRT_ENTRY() \
>> +int main(int argc, char ** argv) \
>> +{ \
>> +   return osl_ProcessHook(sal_main, argc, argv); \
>> +} \
>> +
>> +#else    /* ! SAL_OS2 */
>> +
>> +#define SAL_DEFINE_CRT_ENTRY() \
>> +int main(int argc, char ** argv) \
>> +{ \
>> +    osl_setCommandArgs(argc, argv); \
>> +    return sal_main(argc, argv); \
>> +} \
>
> SAL_DEFINE_CRT_ENTRY had been removed from main.h:1.7, so it looks
> dubious that 1.8 re-introduces it for !(defined SAL_W32 || defined
> SAL_OS2).

Yuri Dario wrote:
 > Hi Stephan,
 >
 >> SAL_DEFINE_CRT_ENTRY had been removed from main.h:1.7, so it looks
 >> dubious that 1.8 re-introduces it for !(defined SAL_W32 || defined
SAL_OS2).
 >
 > if this macro is no longer necessary, it may be removed safely.

Now, who wants to take care of this alleged merge error?

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

Yuri Dario
Hi Stephan,

> >> SAL_DEFINE_CRT_ENTRY had been removed from main.h:1.7, so it looks
>Now, who wants to take care of this alleged merge error?

since there is a new cws for os2 port (os2port02), I can put this
change into it.


Bye,

        Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/yuri
 * http://www.teamos2.it
 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

Yuri Dario
In reply to this post by stephan.bergmann
Hi Stephan,


I looked at new main.h code, and I propose to change it as follows:

#ifdef SAL_OS2

int SAL_CALL osl_setExceptionHook( void);
int SAL_CALL osl_unsetExceptionHook( void);
#define SET_EXCEPTION_HOOK if (osl_setExceptionHook()==0) {
#define UNSET_EXCEPTION_HOOK } osl_unsetExceptionHook()

#else

#define SET_EXCEPTION_HOOK
#define UNSET_EXCEPTION_HOOK

#endif

#define SAL_MAIN_WITH_ARGS_IMPL \
int SAL_CALL main(int argc, char ** argv) \
{ \
        int rc; \
        SET_EXCEPTION_HOOK; \
        osl_setCommandArgs(argc, argv); \
        rc = sal_main_with_args(argc, argv); \
        UNSET_EXCEPTION_HOOK; \
        return rc; \
}

#define SAL_MAIN_IMPL \
int SAL_CALL main(int argc, char ** argv) \
{ \
        int rc; \
        SET_EXCEPTION_HOOK; \
        osl_setCommandArgs(argc, argv); \
        rc = sal_main(); \
        UNSET_EXCEPTION_HOOK; \
        return rc; \
}


the new macros are used to install the OS/2 exception handler, so I can
wrap program execution and dump stack frames at crash.

If you know a better way to put it in common code, please let me know.

thanks,


Bye,

        Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/yuri
 * http://www.teamos2.it
 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

stephan.bergmann
In reply to this post by stephan.bergmann
Yuri Dario wrote:

> Hi Stephan,
>
>
> I looked at new main.h code, and I propose to change it as follows:
>
> #ifdef SAL_OS2
>
> int SAL_CALL osl_setExceptionHook( void);
> int SAL_CALL osl_unsetExceptionHook( void);
> #define SET_EXCEPTION_HOOK if (osl_setExceptionHook()==0) {
> #define UNSET_EXCEPTION_HOOK } osl_unsetExceptionHook()
>
> #else
>
> #define SET_EXCEPTION_HOOK
> #define UNSET_EXCEPTION_HOOK
>
> #endif
>
> #define SAL_MAIN_WITH_ARGS_IMPL \
> int SAL_CALL main(int argc, char ** argv) \
> { \
> int rc; \
> SET_EXCEPTION_HOOK; \
> osl_setCommandArgs(argc, argv); \
> rc = sal_main_with_args(argc, argv); \
> UNSET_EXCEPTION_HOOK; \
> return rc; \
> }
>
> #define SAL_MAIN_IMPL \
> int SAL_CALL main(int argc, char ** argv) \
> { \
> int rc; \
> SET_EXCEPTION_HOOK; \
> osl_setCommandArgs(argc, argv); \
> rc = sal_main(); \
> UNSET_EXCEPTION_HOOK; \
> return rc; \
> }
>
>
> the new macros are used to install the OS/2 exception handler, so I can
> wrap program execution and dump stack frames at crash.
>
> If you know a better way to put it in common code, please let me know.

On CWS sb71, we faced a similar problem (needing initialization and
deinitialization around sal_main on Windows) and changed
SAL_MAIN_WITH_ARGS_IMPL (and correspondingly SAL_MAIN_IMPL) to

#define SAL_MAIN_WITH_ARGS_IMPL \
int SAL_CALL main(int argc, char ** argv) \
{ \
        int ret; \
        sal_detail_initialize(argc, argv);   \
        ret = sal_main_with_args(argc, argv); \
        sal_detail_deinitialize(); \
        return ret; \
}

(see sal/rtl/sal/main.h:1.7.68.2 l. 50--58).  CWS sb71 is not yet
integrated, but planned to be ready for integration on October 5.  So I
would suggest you move your OS/2-specific osl_[un]setExceptionHook
functionality into sal_detail_[de]initialize once CWS sb71 is
integrated.  (Also, it is probably not a good idea anyway to silently
not execute rc=sal_main() when osl_setExceptionHook fails and return a
random uninitialized rc; abort is probably what you want.)  You also no
longer need the changes in sal/util/makefile.mk:1.44.4.1 then.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

Yuri Dario
Hi Stephan,

>(see sal/rtl/sal/main.h:1.7.68.2 l. 50--58).  CWS sb71 is not yet
>integrated, but planned to be ready for integration on October 5.  So I
>would suggest you move your OS/2-specific osl_[un]setExceptionHook


ok, thanks I'll get such code.

>integrated.  (Also, it is probably not a good idea anyway to silently
>not execute rc=sal_main() when osl_setExceptionHook fails and return a
>random uninitialized rc; abort is probably what you want.)  

this is not a problem: if setting the exception handler fails (and this
is very unlikely to happen), we can continue processing as usual, I
only miss the stack trace dump to file; but libc runtime/OS2 handlers
will still log the crash.

TIA,


Bye,

        Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/yuri
 * http://www.teamos2.it
 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: [porting-cvs] CVS update: /porting/sal/inc/sal/main.h

Yuri Dario
In reply to this post by stephan.bergmann
Hi Stephan,

>On CWS sb71, we faced a similar problem (needing initialization and
>deinitialization around sal_main on Windows) and changed
>SAL_MAIN_WITH_ARGS_IMPL (and correspondingly SAL_MAIN_IMPL) to


I merged relevant changes from sb71 into os2port02 (main.h,
salinit.cxx, makefile.mk).

thanks,


Bye,

        Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/yuri
 * http://www.teamos2.it
 */

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]