@@ -130,7 +130,8 @@ required, but is kept for backwards compatibility.
130
130
* XXX Should really be a Configure probe, with HAS__FUNCTION__
131
131
* and FUNCTION__ as results.
132
132
* XXX Similarly, a Configure probe for __FILE__ and __LINE__ is needed. */
133
- #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || (defined(__SUNPRO_C )) /* C99 or close enough. */
133
+ #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \
134
+ (defined(__SUNPRO_C )) /* C99 or close enough. */
134
135
# define FUNCTION__ __func__
135
136
# define SAFE_FUNCTION__ __func__
136
137
#elif (defined(__DECC_VER )) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tru64, -c99 not known, only -std1). */
@@ -457,7 +458,8 @@ Perl_xxx(aTHX_ ...) form for any API calls where it's used.
457
458
Perl_sv_catxmlpvn(aTHX_ dsv, STR_WITH_LEN(str), utf8)
458
459
459
460
460
- #define lex_stuff_pvs (pv ,flags ) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
461
+ #define lex_stuff_pvs (pv ,flags ) \
462
+ Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
461
463
462
464
#define get_cvs (str , flags ) \
463
465
Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags))
@@ -684,7 +686,8 @@ based on the underlying C library functions):
684
686
#define strnNE (s1 ,s2 ,l ) (strncmp(s1,s2,l) != 0)
685
687
#define strnEQ (s1 ,s2 ,l ) (strncmp(s1,s2,l) == 0)
686
688
687
- #define memEQ (s1 ,s2 ,l ) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
689
+ #define memEQ (s1 ,s2 ,l ) \
690
+ (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
688
691
#define memNE (s1 ,s2 ,l ) (! memEQ(s1,s2,l))
689
692
690
693
/* memEQ and memNE where second comparand is a string constant */
@@ -716,7 +719,8 @@ based on the underlying C library functions):
716
719
#define memGT (s1 ,s2 ,l ) (memcmp(s1,s2,l) > 0)
717
720
#define memGE (s1 ,s2 ,l ) (memcmp(s1,s2,l) >= 0)
718
721
719
- #define memCHRs (s1 ,c ) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
722
+ #define memCHRs (s1 ,c ) \
723
+ ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
720
724
721
725
/*
722
726
* Character classes.
@@ -1638,7 +1642,8 @@ END_EXTERN_C
1638
1642
# define isPUNCT_A (c ) generic_isCC_A_(c, CC_PUNCT_)
1639
1643
# define isSPACE_A (c ) generic_isCC_A_(c, CC_SPACE_)
1640
1644
# define isWORDCHAR_A (c ) generic_isCC_A_(c, CC_WORDCHAR_)
1641
- # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */
1645
+ # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII
1646
+ xdigits */
1642
1647
# define isIDFIRST_A (c ) generic_isCC_A_(c, CC_IDFIRST_)
1643
1648
# define isALPHA_L1 (c ) generic_isCC_(c, CC_ALPHA_)
1644
1649
# define isALPHANUMERIC_L1 (c ) generic_isCC_(c, CC_ALPHANUMERIC_)
@@ -2176,11 +2181,13 @@ END_EXTERN_C
2176
2181
#define isPRINT_uvchr (c ) generic_invlist_uvchr_(CC_PRINT_, c)
2177
2182
2178
2183
#define isPUNCT_uvchr (c ) generic_invlist_uvchr_(CC_PUNCT_, c)
2179
- #define isSPACE_uvchr (c ) generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2184
+ #define isSPACE_uvchr (c ) \
2185
+ generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2180
2186
#define isPSXSPC_uvchr (c ) isSPACE_uvchr(c)
2181
2187
2182
2188
#define isUPPER_uvchr (c ) generic_invlist_uvchr_(CC_UPPER_, c)
2183
- #define isVERTWS_uvchr (c ) generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2189
+ #define isVERTWS_uvchr (c ) \
2190
+ generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2184
2191
#define isWORDCHAR_uvchr (c ) generic_invlist_uvchr_(CC_WORDCHAR_, c)
2185
2192
#define isXDIGIT_uvchr (c ) generic_uvchr_(CC_XDIGIT_, is_XDIGIT_cp_high, c)
2186
2193
@@ -2721,7 +2728,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2721
2728
2722
2729
#define MEM_SIZE_MAX ((MEM_SIZE)-1)
2723
2730
2724
- #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2731
+ #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) \
2732
+ (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2725
2733
2726
2734
#ifdef PERL_MALLOC_WRAP
2727
2735
@@ -2775,7 +2783,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2775
2783
2776
2784
# define MEM_WRAP_CHECK_ (n ,t ) MEM_WRAP_CHECK(n,t),
2777
2785
2778
- # 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))
2786
+ # define PERL_STRLEN_ROUNDUP (n ) \
2787
+ ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
2779
2788
#else
2780
2789
2781
2790
# define MEM_WRAP_CHECK (n ,t )
@@ -2835,9 +2844,12 @@ enum mem_log_type {
2835
2844
#endif
2836
2845
2837
2846
#ifdef PERL_MEM_LOG
2838
- #define MEM_LOG_ALLOC (n ,t ,a ) Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2839
- #define MEM_LOG_REALLOC (n ,t ,v ,a ) Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2840
- #define MEM_LOG_FREE (a ) Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2847
+ #define MEM_LOG_ALLOC (n ,t ,a ) \
2848
+ Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2849
+ #define MEM_LOG_REALLOC (n ,t ,v ,a ) \
2850
+ Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2851
+ #define MEM_LOG_FREE (a ) \
2852
+ Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2841
2853
#endif
2842
2854
2843
2855
#ifndef MEM_LOG_ALLOC
@@ -2850,9 +2862,12 @@ enum mem_log_type {
2850
2862
#define MEM_LOG_FREE (a ) (a)
2851
2863
#endif
2852
2864
2853
- #define Newx (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2854
- #define Newxc (v ,n ,t ,c ) (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2855
- #define Newxz (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2865
+ #define Newx (v ,n ,t ) \
2866
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2867
+ #define Newxc (v ,n ,t ,c ) \
2868
+ (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2869
+ #define Newxz (v ,n ,t ) \
2870
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2856
2871
2857
2872
#ifndef PERL_CORE
2858
2873
/* pre 5.9.x compatibility */
@@ -2879,16 +2894,23 @@ enum mem_log_type {
2879
2894
#define perl_assert_ptr (p ) assert( ((void*)(p)) != 0 )
2880
2895
2881
2896
2882
- #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)))
2883
- #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)))
2884
- #define Zero (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2897
+ #define Move (s ,d ,n ,t ) \
2898
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2899
+ #define Copy (s ,d ,n ,t ) \
2900
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2901
+ #define Zero (d ,n ,t ) \
2902
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2885
2903
2886
2904
/* Like above, but returns a pointer to 'd' */
2887
- #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)))
2888
- #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)))
2889
- #define ZeroD (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2890
-
2891
- #define PoisonWith (d ,n ,t ,b ) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2905
+ #define MoveD (s ,d ,n ,t ) \
2906
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2907
+ #define CopyD (s ,d ,n ,t ) \
2908
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2909
+ #define ZeroD (d ,n ,t ) \
2910
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2911
+
2912
+ #define PoisonWith (d ,n ,t ,b ) \
2913
+ (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2892
2914
#define PoisonNew (d ,n ,t ) PoisonWith(d,n,t,0xAB)
2893
2915
#define PoisonFree (d ,n ,t ) PoisonWith(d,n,t,0xEF)
2894
2916
#define Poison (d ,n ,t ) PoisonFree(d,n,t)
0 commit comments