@@ -158,7 +158,8 @@ required, but is kept for backwards compatibility.
158
158
* XXX Should really be a Configure probe, with HAS__FUNCTION__
159
159
* and FUNCTION__ as results.
160
160
* XXX Similarly, a Configure probe for __FILE__ and __LINE__ is needed. */
161
- #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || (defined(__SUNPRO_C )) /* C99 or close enough. */
161
+ #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \
162
+ (defined(__SUNPRO_C )) /* C99 or close enough. */
162
163
# define FUNCTION__ __func__
163
164
# define SAFE_FUNCTION__ __func__
164
165
#elif (defined(__DECC_VER )) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tru64, -c99 not known, only -std1). */
@@ -483,7 +484,8 @@ Perl_xxx(aTHX_ ...) form for any API calls where it's used.
483
484
#define gv_fetchpvn gv_fetchpvn_flags
484
485
485
486
486
- #define lex_stuff_pvs (pv ,flags ) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
487
+ #define lex_stuff_pvs (pv ,flags ) \
488
+ Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
487
489
488
490
#define get_cvs (str , flags ) \
489
491
Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags))
@@ -710,7 +712,8 @@ based on the underlying C library functions):
710
712
#define strnNE (s1 ,s2 ,l ) (strncmp(s1,s2,l) != 0)
711
713
#define strnEQ (s1 ,s2 ,l ) (strncmp(s1,s2,l) == 0)
712
714
713
- #define memEQ (s1 ,s2 ,l ) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
715
+ #define memEQ (s1 ,s2 ,l ) \
716
+ (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
714
717
#define memNE (s1 ,s2 ,l ) (! memEQ(s1,s2,l))
715
718
716
719
/* memEQ and memNE where second comparand is a string constant */
@@ -742,7 +745,8 @@ based on the underlying C library functions):
742
745
#define memGT (s1 ,s2 ,l ) (memcmp(s1,s2,l) > 0)
743
746
#define memGE (s1 ,s2 ,l ) (memcmp(s1,s2,l) >= 0)
744
747
745
- #define memCHRs (s1 ,c ) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
748
+ #define memCHRs (s1 ,c ) \
749
+ ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
746
750
747
751
/*
748
752
* Character classes.
@@ -1664,7 +1668,8 @@ END_EXTERN_C
1664
1668
# define isPUNCT_A (c ) generic_isCC_A_(c, CC_PUNCT_)
1665
1669
# define isSPACE_A (c ) generic_isCC_A_(c, CC_SPACE_)
1666
1670
# define isWORDCHAR_A (c ) generic_isCC_A_(c, CC_WORDCHAR_)
1667
- # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */
1671
+ # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII
1672
+ xdigits */
1668
1673
# define isIDFIRST_A (c ) generic_isCC_A_(c, CC_IDFIRST_)
1669
1674
# define isALPHA_L1 (c ) generic_isCC_(c, CC_ALPHA_)
1670
1675
# define isALPHANUMERIC_L1 (c ) generic_isCC_(c, CC_ALPHANUMERIC_)
@@ -2202,11 +2207,13 @@ END_EXTERN_C
2202
2207
#define isPRINT_uvchr (c ) generic_invlist_uvchr_(CC_PRINT_, c)
2203
2208
2204
2209
#define isPUNCT_uvchr (c ) generic_invlist_uvchr_(CC_PUNCT_, c)
2205
- #define isSPACE_uvchr (c ) generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2210
+ #define isSPACE_uvchr (c ) \
2211
+ generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2206
2212
#define isPSXSPC_uvchr (c ) isSPACE_uvchr(c)
2207
2213
2208
2214
#define isUPPER_uvchr (c ) generic_invlist_uvchr_(CC_UPPER_, c)
2209
- #define isVERTWS_uvchr (c ) generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2215
+ #define isVERTWS_uvchr (c ) \
2216
+ generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2210
2217
#define isWORDCHAR_uvchr (c ) generic_invlist_uvchr_(CC_WORDCHAR_, c)
2211
2218
#define isXDIGIT_uvchr (c ) generic_uvchr_(CC_XDIGIT_, is_XDIGIT_cp_high, c)
2212
2219
@@ -2751,7 +2758,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2751
2758
2752
2759
#define MEM_SIZE_MAX ((MEM_SIZE)-1)
2753
2760
2754
- #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2761
+ #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) \
2762
+ (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2755
2763
2756
2764
#ifdef PERL_MALLOC_WRAP
2757
2765
@@ -2805,7 +2813,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2805
2813
2806
2814
# define MEM_WRAP_CHECK_ (n ,t ) MEM_WRAP_CHECK(n,t),
2807
2815
2808
- # define PERL_STRLEN_ROUNDUP (n ) ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
2816
+ # define PERL_STRLEN_ROUNDUP (n ) \
2817
+ ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
2809
2818
#else
2810
2819
2811
2820
# define MEM_WRAP_CHECK (n ,t )
@@ -2865,9 +2874,12 @@ enum mem_log_type {
2865
2874
#endif
2866
2875
2867
2876
#ifdef PERL_MEM_LOG
2868
- #define MEM_LOG_ALLOC (n ,t ,a ) Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2869
- #define MEM_LOG_REALLOC (n ,t ,v ,a ) Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2870
- #define MEM_LOG_FREE (a ) Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2877
+ #define MEM_LOG_ALLOC (n ,t ,a ) \
2878
+ Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2879
+ #define MEM_LOG_REALLOC (n ,t ,v ,a ) \
2880
+ Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2881
+ #define MEM_LOG_FREE (a ) \
2882
+ Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2871
2883
#endif
2872
2884
2873
2885
#ifndef MEM_LOG_ALLOC
@@ -2880,9 +2892,12 @@ enum mem_log_type {
2880
2892
#define MEM_LOG_FREE (a ) (a)
2881
2893
#endif
2882
2894
2883
- #define Newx (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2884
- #define Newxc (v ,n ,t ,c ) (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2885
- #define Newxz (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2895
+ #define Newx (v ,n ,t ) \
2896
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2897
+ #define Newxc (v ,n ,t ,c ) \
2898
+ (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2899
+ #define Newxz (v ,n ,t ) \
2900
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2886
2901
2887
2902
#ifndef PERL_CORE
2888
2903
/* pre 5.9.x compatibility */
@@ -2909,22 +2924,29 @@ enum mem_log_type {
2909
2924
#define perl_assert_ptr (p ) assert( ((void*)(p)) != 0 )
2910
2925
2911
2926
2912
- #define Move (s ,d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2913
- #define Copy (s ,d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2914
- #define Zero (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2927
+ #define Move (s ,d ,n ,t ) \
2928
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2929
+ #define Copy (s ,d ,n ,t ) \
2930
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2931
+ #define Zero (d ,n ,t ) \
2932
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2915
2933
2916
2934
/* Like above, but returns a pointer to 'd' */
2917
- #define MoveD (s ,d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2918
- #define CopyD (s ,d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2919
- #define ZeroD (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2935
+ #define MoveD (s ,d ,n ,t ) \
2936
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2937
+ #define CopyD (s ,d ,n ,t ) \
2938
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2939
+ #define ZeroD (d ,n ,t ) \
2940
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2920
2941
2921
2942
#define NewCopy (s ,d ,n ,t ) \
2922
2943
STMT_START { \
2923
2944
Newx(d,n,t); \
2924
2945
Copy(s,d,n,t); \
2925
2946
} STMT_END
2926
2947
2927
- #define PoisonWith (d ,n ,t ,b ) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2948
+ #define PoisonWith (d ,n ,t ,b ) \
2949
+ (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2928
2950
#define PoisonNew (d ,n ,t ) PoisonWith(d,n,t,0xAB)
2929
2951
#define PoisonFree (d ,n ,t ) PoisonWith(d,n,t,0xEF)
2930
2952
#define Poison (d ,n ,t ) PoisonFree(d,n,t)
0 commit comments