@@ -2575,9 +2575,13 @@ double exp(double x)
2575
2575
__CPROVER_assume (result >= lower );
2576
2576
__CPROVER_assume (result <= upper );
2577
2577
2578
- _Static_assert (
2579
- sizeof (double ) == 2 * sizeof (int32_t ),
2580
- "bit width of double is 2x bit width of int32_t" );
2578
+ #ifndef _MSC_VER
2579
+ _Static_assert
2580
+ #else
2581
+ static_assert
2582
+ #endif
2583
+ (sizeof (double ) == 2 * sizeof (int32_t ),
2584
+ "bit width of double is 2x bit width of int32_t" );
2581
2585
union U
2582
2586
{
2583
2587
double d ;
@@ -2642,9 +2646,13 @@ float expf(float x)
2642
2646
__CPROVER_assume (result >= lower );
2643
2647
__CPROVER_assume (result <= upper );
2644
2648
2645
- _Static_assert (
2646
- sizeof (float ) == sizeof (int32_t ),
2647
- "bit width of float and int32_t should match" );
2649
+ #ifndef _MSC_VER
2650
+ _Static_assert
2651
+ #else
2652
+ static_assert
2653
+ #endif
2654
+ (sizeof (float ) == sizeof (int32_t ),
2655
+ "bit width of float and int32_t should match" );
2648
2656
union U
2649
2657
{
2650
2658
float f ;
@@ -2713,9 +2721,13 @@ long double expl(long double x)
2713
2721
__CPROVER_assume (result >= lower );
2714
2722
__CPROVER_assume (result <= upper );
2715
2723
2716
- _Static_assert (
2717
- sizeof (long double ) % sizeof (int32_t ) == 0 ,
2718
- "bit width of long double is a multiple of bit width of int32_t" );
2724
+ # ifndef _MSC_VER
2725
+ _Static_assert
2726
+ # else
2727
+ static_assert
2728
+ # endif
2729
+ (sizeof (long double ) % sizeof (int32_t ) == 0 ,
2730
+ "bit width of long double is a multiple of bit width of int32_t" );
2719
2731
union
2720
2732
{
2721
2733
long double l ;
@@ -2772,9 +2784,13 @@ double log(double x)
2772
2784
#pragma CPROVER check pop
2773
2785
}
2774
2786
2775
- _Static_assert (
2776
- sizeof (double ) == 2 * sizeof (int32_t ),
2777
- "bit width of double is 2x bit width of int32_t" );
2787
+ #ifndef _MSC_VER
2788
+ _Static_assert
2789
+ #else
2790
+ static_assert
2791
+ #endif
2792
+ (sizeof (double ) == 2 * sizeof (int32_t ),
2793
+ "bit width of double is 2x bit width of int32_t" );
2778
2794
// https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
2779
2795
union
2780
2796
{
@@ -2833,9 +2849,13 @@ float logf(float x)
2833
2849
#pragma CPROVER check pop
2834
2850
}
2835
2851
2836
- _Static_assert (
2837
- sizeof (float ) == sizeof (int32_t ),
2838
- "bit width of float and int32_t should match" );
2852
+ #ifndef _MSC_VER
2853
+ _Static_assert
2854
+ #else
2855
+ static_assert
2856
+ #endif
2857
+ (sizeof (float ) == sizeof (int32_t ),
2858
+ "bit width of float and int32_t should match" );
2839
2859
// https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
2840
2860
union
2841
2861
{
@@ -2898,9 +2918,13 @@ long double logl(long double x)
2898
2918
#if LDBL_MAX_EXP == DBL_MAX_EXP
2899
2919
return log (x );
2900
2920
#else
2901
- _Static_assert (
2902
- sizeof (long double ) % sizeof (int32_t ) == 0 ,
2903
- "bit width of long double is a multiple of bit width of int32_t" );
2921
+ # ifndef _MSC_VER
2922
+ _Static_assert
2923
+ # else
2924
+ static_assert
2925
+ # endif
2926
+ (sizeof (long double ) % sizeof (int32_t ) == 0 ,
2927
+ "bit width of long double is a multiple of bit width of int32_t" );
2904
2928
union
2905
2929
{
2906
2930
long double l ;
@@ -2962,9 +2986,13 @@ double log2(double x)
2962
2986
#pragma CPROVER check pop
2963
2987
}
2964
2988
2965
- _Static_assert (
2966
- sizeof (double ) == 2 * sizeof (int32_t ),
2967
- "bit width of double is 2x bit width of int32_t" );
2989
+ #ifndef _MSC_VER
2990
+ _Static_assert
2991
+ #else
2992
+ static_assert
2993
+ #endif
2994
+ (sizeof (double ) == 2 * sizeof (int32_t ),
2995
+ "bit width of double is 2x bit width of int32_t" );
2968
2996
union
2969
2997
{
2970
2998
double d ;
@@ -3022,9 +3050,13 @@ float log2f(float x)
3022
3050
#pragma CPROVER check pop
3023
3051
}
3024
3052
3025
- _Static_assert (
3026
- sizeof (float ) == sizeof (int32_t ),
3027
- "bit width of float and int32_t should match" );
3053
+ #ifndef _MSC_VER
3054
+ _Static_assert
3055
+ #else
3056
+ static_assert
3057
+ #endif
3058
+ (sizeof (float ) == sizeof (int32_t ),
3059
+ "bit width of float and int32_t should match" );
3028
3060
union
3029
3061
{
3030
3062
float f ;
@@ -3086,9 +3118,13 @@ long double log2l(long double x)
3086
3118
#if LDBL_MAX_EXP == DBL_MAX_EXP
3087
3119
return log2 (x );
3088
3120
#else
3089
- _Static_assert (
3090
- sizeof (long double ) % sizeof (int32_t ) == 0 ,
3091
- "bit width of long double is a multiple of bit width of int32_t" );
3121
+ # ifndef _MSC_VER
3122
+ _Static_assert
3123
+ # else
3124
+ static_assert
3125
+ # endif
3126
+ (sizeof (long double ) % sizeof (int32_t ) == 0 ,
3127
+ "bit width of long double is a multiple of bit width of int32_t" );
3092
3128
union
3093
3129
{
3094
3130
long double l ;
@@ -3150,9 +3186,13 @@ double log10(double x)
3150
3186
#pragma CPROVER check pop
3151
3187
}
3152
3188
3153
- _Static_assert (
3154
- sizeof (double ) == 2 * sizeof (int32_t ),
3155
- "bit width of double is 2x bit width of int32_t" );
3189
+ #ifndef _MSC_VER
3190
+ _Static_assert
3191
+ #else
3192
+ static_assert
3193
+ #endif
3194
+ (sizeof (double ) == 2 * sizeof (int32_t ),
3195
+ "bit width of double is 2x bit width of int32_t" );
3156
3196
// https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
3157
3197
union
3158
3198
{
@@ -3213,9 +3253,13 @@ float log10f(float x)
3213
3253
#pragma CPROVER check pop
3214
3254
}
3215
3255
3216
- _Static_assert (
3217
- sizeof (float ) == sizeof (int32_t ),
3218
- "bit width of float and int32_t should match" );
3256
+ #ifndef _MSC_VER
3257
+ _Static_assert
3258
+ #else
3259
+ static_assert
3260
+ #endif
3261
+ (sizeof (float ) == sizeof (int32_t ),
3262
+ "bit width of float and int32_t should match" );
3219
3263
// https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
3220
3264
union
3221
3265
{
@@ -3279,9 +3323,13 @@ long double log10l(long double x)
3279
3323
#if LDBL_MAX_EXP == DBL_MAX_EXP
3280
3324
return log10 (x );
3281
3325
#else
3282
- _Static_assert (
3283
- sizeof (long double ) % sizeof (int32_t ) == 0 ,
3284
- "bit width of long double is a multiple of bit width of int32_t" );
3326
+ # ifndef _MSC_VER
3327
+ _Static_assert
3328
+ # else
3329
+ static_assert
3330
+ # endif
3331
+ (sizeof (long double ) % sizeof (int32_t ) == 0 ,
3332
+ "bit width of long double is a multiple of bit width of int32_t" );
3285
3333
union
3286
3334
{
3287
3335
long double l ;
@@ -3404,9 +3452,13 @@ double pow(double x, double y)
3404
3452
return 0.0 / 0.0 ;
3405
3453
#pragma CPROVER check pop
3406
3454
3407
- _Static_assert (
3408
- sizeof (double ) == 2 * sizeof (int32_t ),
3409
- "bit width of double is 2x bit width of int32_t" );
3455
+ #ifndef _MSC_VER
3456
+ _Static_assert
3457
+ #else
3458
+ static_assert
3459
+ #endif
3460
+ (sizeof (double ) == 2 * sizeof (int32_t ),
3461
+ "bit width of double is 2x bit width of int32_t" );
3410
3462
// https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
3411
3463
union
3412
3464
{
@@ -3545,9 +3597,13 @@ float powf(float x, float y)
3545
3597
return 0.0f / 0.0f ;
3546
3598
#pragma CPROVER check pop
3547
3599
3548
- _Static_assert (
3549
- sizeof (float ) == sizeof (int32_t ),
3550
- "bit width of float and int32_t should match" );
3600
+ #ifndef _MSC_VER
3601
+ _Static_assert
3602
+ #else
3603
+ static_assert
3604
+ #endif
3605
+ (sizeof (float ) == sizeof (int32_t ),
3606
+ "bit width of float and int32_t should match" );
3551
3607
union
3552
3608
{
3553
3609
float f ;
@@ -3684,9 +3740,13 @@ long double powl(long double x, long double y)
3684
3740
#if LDBL_MAX_EXP == DBL_MAX_EXP
3685
3741
return pow (x , y );
3686
3742
#else
3687
- _Static_assert (
3688
- sizeof (long double ) % sizeof (int32_t ) == 0 ,
3689
- "bit width of long double is a multiple of bit width of int32_t" );
3743
+ # ifndef _MSC_VER
3744
+ _Static_assert
3745
+ # else
3746
+ static_assert
3747
+ # endif
3748
+ (sizeof (long double ) % sizeof (int32_t ) == 0 ,
3749
+ "bit width of long double is a multiple of bit width of int32_t" );
3690
3750
union U
3691
3751
{
3692
3752
long double l ;
0 commit comments