mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4756
This commit is contained in:
parent
d11fe55856
commit
f3749f8128
|
@ -20668,3 +20668,10 @@ Bruce 3 Dec 2004 (Thanks Reinhard!!)
|
|||
Makefile.am
|
||||
diagnostics.h
|
||||
filesys.h
|
||||
|
||||
Rom 3 Dec 2004
|
||||
- Fix build break on Windows where VC didn't like a C prototyped function
|
||||
possibly throwing a C++ exception.
|
||||
|
||||
lib/
|
||||
diagnostics.C, .h
|
||||
|
|
|
@ -79,28 +79,45 @@ int boinc_init_diagnostics(int _flags) {
|
|||
if (flags & BOINC_DIAG_REDIRECTSTDERR ) {
|
||||
lpRetVal = (void*) freopen(BOINC_DIAG_STDERR, "a", stderr);
|
||||
if ( NULL == lpRetVal ) {
|
||||
#ifdef __cplusplus
|
||||
BOINCFILEERROR("Failed to reopen stderr for diagnostics redirection" );
|
||||
#else
|
||||
return ERR_FOPEN;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BOINC_DIAG_REDIRECTSTDERROVERWRITE ) {
|
||||
lpRetVal = (void*) freopen(BOINC_DIAG_STDERR, "w", stderr);
|
||||
if ( NULL == lpRetVal ) {
|
||||
#ifdef __cplusplus
|
||||
BOINCFILEERROR("Failed to reopen stderr for diagnostics redirection (overwrite)" );
|
||||
#else
|
||||
return ERR_FOPEN;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BOINC_DIAG_REDIRECTSTDOUT ) {
|
||||
lpRetVal = (void*) freopen(BOINC_DIAG_STDOUT, "a", stdout);
|
||||
if ( NULL == lpRetVal ) {
|
||||
#ifdef __cplusplus
|
||||
BOINCFILEERROR( "Failed to reopen stdout for diagnostics redirection" );
|
||||
#else
|
||||
return ERR_FOPEN;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BOINC_DIAG_REDIRECTSTDOUTOVERWRITE ) {
|
||||
lpRetVal = (void*) freopen(BOINC_DIAG_STDOUT, "w", stdout);
|
||||
if ( NULL == lpRetVal )
|
||||
if ( NULL == lpRetVal ) {
|
||||
#ifdef __cplusplus
|
||||
BOINCFILEERROR( "Failed to reopen stdout for diagnostics redirection (overwrite)" );
|
||||
#else
|
||||
return ERR_FOPEN;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,9 +152,13 @@ int boinc_init_diagnostics(int _flags) {
|
|||
|
||||
|
||||
// Install unhandled exception filters and signal traps.
|
||||
if ( BOINC_SUCCESS != boinc_install_signal_handlers() )
|
||||
if ( BOINC_SUCCESS != boinc_install_signal_handlers() ) {
|
||||
#ifdef __cplusplus
|
||||
BOINCSIGNALERROR( "Failed to install signal handlers" );
|
||||
|
||||
#else
|
||||
return ERR_SIGNAL_OP;
|
||||
#endif
|
||||
}
|
||||
|
||||
return BOINC_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -24,31 +24,6 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* pure ANSI C API follows here
|
||||
*/
|
||||
#ifndef BOINCASSERT
|
||||
#define BOINCASSERT assert
|
||||
#endif
|
||||
|
||||
#ifndef BOINCTRACE
|
||||
#define BOINCTRACE __noop
|
||||
#endif
|
||||
|
||||
#ifndef BOINCINFO
|
||||
#define BOINCINFO __noop
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern int boinc_init_diagnostics(int flags);
|
||||
extern int boinc_finish_diag(void);
|
||||
extern int boinc_install_signal_handlers(void);
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
// flags for boinc_init_diagnostics()
|
||||
//
|
||||
#define BOINC_DIAG_DUMPCALLSTACKENABLED 0x00000001L
|
||||
|
@ -155,4 +130,25 @@ extern void boinc_set_signal_handler(int sig, void(*handler)(int));
|
|||
extern void boinc_set_signal_handler_force(int sig, void(*handler)(int));
|
||||
#endif // ! _WIN32
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* pure ANSI C API follows here
|
||||
*/
|
||||
#ifndef BOINCASSERT
|
||||
#define BOINCASSERT assert
|
||||
#endif
|
||||
|
||||
#ifndef BOINCTRACE
|
||||
#define BOINCTRACE __noop
|
||||
#endif
|
||||
|
||||
#ifndef BOINCINFO
|
||||
#define BOINCINFO __noop
|
||||
#endif
|
||||
|
||||
extern int boinc_init_diagnostics(int flags);
|
||||
extern int boinc_finish_diag(void);
|
||||
extern int boinc_install_signal_handlers(void);
|
||||
|
||||
|
||||
#endif /* double-inclusion protection */
|
||||
|
|
Loading…
Reference in New Issue