diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 9 | ||||
-rw-r--r-- | include/memory.h | 2 | ||||
-rw-r--r-- | include/mpi.h | 14 | ||||
-rw-r--r-- | include/util.h | 8 |
4 files changed, 24 insertions, 9 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 01a57e26a..02cc439dc 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,12 @@ +2002-05-10 Stefan Bellon <[email protected]> + + * mpi.h: New function mpi_debug_alloc_like for M_DEBUG. + + * util.h [__riscos__]: Make use of __func__ that later + Norcroft compiler provides. + + * memory.h: Fixed wrong definition of m_alloc_secure_clear. + 2002-04-23 David Shaw <[email protected]> * util.h: New function answer_is_yes_no_default() to give a diff --git a/include/memory.h b/include/memory.h index 5a405d18b..6a364795b 100644 --- a/include/memory.h +++ b/include/memory.h @@ -33,7 +33,7 @@ #define m_alloc(n) m_debug_alloc((n), M_DBGINFO( __LINE__ ) ) #define m_alloc_clear(n) m_debug_alloc_clear((n), M_DBGINFO(__LINE__) ) #define m_alloc_secure(n) m_debug_alloc((n), M_DBGINFO(__LINE__) ) -#define m_alloc_secure_clear(n) m_debug_alloc((n), M_DBGINFO(__LINE__) ) +#define m_alloc_secure_clear(n) m_debug_alloc_secure_clear((n), M_DBGINFO(__LINE__) ) #define m_realloc(n,m) m_debug_realloc((n),(m), M_DBGINFO(__LINE__) ) #define m_free(n) m_debug_free((n), M_DBGINFO(__LINE__) ) #define m_check(n) m_debug_check((n), M_DBGINFO(__LINE__) ) diff --git a/include/mpi.h b/include/mpi.h index 99bd6a883..80d617b1d 100644 --- a/include/mpi.h +++ b/include/mpi.h @@ -88,19 +88,22 @@ typedef struct gcry_mpi *MPI; /*-- mpiutil.c --*/ #ifdef M_DEBUG - #define mpi_alloc(n) mpi_debug_alloc((n), M_DBGINFO( __LINE__ ) ) - #define mpi_alloc_secure(n) mpi_debug_alloc_secure((n), M_DBGINFO( __LINE__ ) ) - #define mpi_free(a) mpi_debug_free((a), M_DBGINFO(__LINE__) ) - #define mpi_resize(a,b) mpi_debug_resize((a),(b), M_DBGINFO(__LINE__) ) - #define mpi_copy(a) mpi_debug_copy((a), M_DBGINFO(__LINE__) ) + #define mpi_alloc(n) mpi_debug_alloc((n), M_DBGINFO( __LINE__ ) ) + #define mpi_alloc_secure(n) mpi_debug_alloc_secure((n), M_DBGINFO( __LINE__ ) ) + #define mpi_alloc_like(n) mpi_debug_alloc_like((n), M_DBGINFO( __LINE__ ) ) + #define mpi_free(a) mpi_debug_free((a), M_DBGINFO(__LINE__) ) + #define mpi_resize(a,b) mpi_debug_resize((a),(b), M_DBGINFO(__LINE__) ) + #define mpi_copy(a) mpi_debug_copy((a), M_DBGINFO(__LINE__) ) MPI mpi_debug_alloc( unsigned nlimbs, const char *info ); MPI mpi_debug_alloc_secure( unsigned nlimbs, const char *info ); + MPI mpi_debug_alloc_like( MPI a, const char *info ); void mpi_debug_free( MPI a, const char *info ); void mpi_debug_resize( MPI a, unsigned nlimbs, const char *info ); MPI mpi_debug_copy( MPI a, const char *info ); #else MPI mpi_alloc( unsigned nlimbs ); MPI mpi_alloc_secure( unsigned nlimbs ); + MPI mpi_alloc_like( MPI a ); void mpi_free( MPI a ); void mpi_resize( MPI a, unsigned nlimbs ); MPI mpi_copy( MPI a ); @@ -114,7 +117,6 @@ void *mpi_get_opaque( MPI a, int *len ); #define mpi_is_secure(a) ((a) && ((a)->flags&1)) void mpi_set_secure( MPI a ); void mpi_clear( MPI a ); -MPI mpi_alloc_like( MPI a ); void mpi_set( MPI w, MPI u); void mpi_set_ui( MPI w, ulong u); MPI mpi_alloc_set_ui( unsigned long u); diff --git a/include/util.h b/include/util.h index 0d90c7e95..908f4b4e0 100644 --- a/include/util.h +++ b/include/util.h @@ -72,8 +72,8 @@ int log_get_errorcount( int clear ); void log_inc_errorcount(void); void g10_log_hexdump( const char *text, const char *buf, size_t len ); -#if !defined (__riscos__) \ - && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )) +#if defined (__riscos__) \ + || (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )) void g10_log_bug( const char *fmt, ... ) __attribute__ ((noreturn, format (printf,1,2))); void g10_log_bug0( const char *, int, const char * ) __attribute__ ((noreturn)); @@ -90,8 +90,12 @@ void g10_log_hexdump( const char *text, const char *buf, size_t len ); __attribute__ ((format (printf,2,3))); void g10_log_debug_f( const char *fname, const char *fmt, ... ) __attribute__ ((format (printf,2,3))); +#ifndef __riscos__ #define BUG() g10_log_bug0( __FILE__ , __LINE__, __FUNCTION__ ) #else + #define BUG() g10_log_bug0( __FILE__ , __LINE__, __func__ ) +#endif +#else void g10_log_bug( const char *fmt, ... ); void g10_log_bug0( const char *, int ); void g10_log_fatal( const char *fmt, ... ); |