Remove C++20 requirement (#257)

* Remove C++20 requirement

* Roll back C features not supported in VS2017
This commit is contained in:
Roland Rabien
2022-12-11 10:03:07 -08:00
committed by GitHub
parent 6ed786957e
commit e70d47baab
2 changed files with 25 additions and 30 deletions

6
ggml.c
View File

@ -155,7 +155,8 @@ static inline float fp32_from_bits(uint32_t w) {
union {
uint32_t as_bits;
float as_value;
} fp32 = { w };
} fp32;
fp32.as_bits = w;
return fp32.as_value;
}
@ -163,7 +164,8 @@ static inline uint32_t fp32_to_bits(float f) {
union {
float as_value;
uint32_t as_bits;
} fp32 = { f };
} fp32;
fp32.as_value = f;
return fp32.as_bits;
}