Skip to content

Commit

Permalink
Use vectorcall convention and override with cdecl as needed.
Browse files Browse the repository at this point in the history
pleroy committed May 22, 2021
1 parent 8751c3f commit c50b3a6
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions absl/debugging/failure_signal_handler.cc
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ struct FailureSignalData {
using StructSigaction = struct sigaction;
#define FSD_PREVIOUS_INIT FailureSignalData::StructSigaction()
#else
void (*previous_handler)(int);
void (__cdecl *previous_handler)(int);
#define FSD_PREVIOUS_INIT SIG_DFL
#endif
};
@@ -209,7 +209,7 @@ static void InstallOneFailureHandler(FailureSignalData* data,
#else

static void InstallOneFailureHandler(FailureSignalData* data,
void (*handler)(int)) {
void (__cdecl *handler)(int)) {
data->previous_handler = signal(data->signo, handler);
ABSL_RAW_CHECK(data->previous_handler != SIG_ERR, "signal() failed");
}
@@ -317,7 +317,7 @@ using GetTidType = decltype(absl::base_internal::GetTID());
ABSL_CONST_INIT static std::atomic<GetTidType> failed_tid(0);

#ifndef ABSL_HAVE_SIGACTION
static void AbslFailureSignalHandler(int signo) {
static void __cdecl AbslFailureSignalHandler(int signo) {
void* ucontext = nullptr;
#else
static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) {
2 changes: 1 addition & 1 deletion absl/hash/internal/print_hash_of.cc
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
#include "absl/hash/hash.h"

// Prints the hash of argv[1].
int main(int argc, char** argv) {
int __cdecl main(int argc, char** argv) {
if (argc < 2) return 1;
printf("%zu\n", absl::Hash<int>{}(std::atoi(argv[1]))); // NOLINT
}
2 changes: 1 addition & 1 deletion absl/strings/ascii_benchmark.cc
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ void AsciiBenchmark(benchmark::State& state, Function f) {
state.SetBytesProcessed(state.iterations() * bytes.size());
}

using StdAsciiFunction = int (*)(int);
using StdAsciiFunction = int (__cdecl*)(int);
template <StdAsciiFunction f>
void BM_Ascii(benchmark::State& state) {
AsciiBenchmark(state, f);
4 changes: 2 additions & 2 deletions absl/time/internal/cctz/src/time_zone_info.cc
Original file line number Diff line number Diff line change
@@ -615,7 +615,7 @@ class FileZoneInfoSource : public ZoneInfoSource {
: fp_(fp, fclose), len_(len) {}

private:
std::unique_ptr<FILE, int (*)(FILE*)> fp_;
std::unique_ptr<FILE, int (__cdecl*)(FILE*)> fp_;
std::size_t len_;
};

@@ -676,7 +676,7 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
// See Android's libc/tzcode/bionic.cpp for additional information.
for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
"/system/usr/share/zoneinfo/tzdata"}) {
std::unique_ptr<FILE, int (*)(FILE*)> fp(FOpen(tzdata, "rb"), fclose);
std::unique_ptr<FILE, int(__cdecl*)(FILE*)> fp(FOpen(tzdata, "rb"), fclose);
if (fp.get() == nullptr) continue;

char hbuf[24]; // covers header.zonetab_offset too
16 changes: 8 additions & 8 deletions absl/time/internal/cctz/src/zone_info_source.cc
Original file line number Diff line number Diff line change
@@ -69,17 +69,17 @@ ZoneInfoSourceFactory default_factory = DefaultFactory;
#pragma comment( \
linker, \
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@ABV?$function@$$A6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@@ZA=?default_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@ABV?$function@$$A6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@@ZA")
@@ -88,17 +88,17 @@ ZoneInfoSourceFactory default_factory = DefaultFactory;
#pragma comment( \
linker, \
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@AEBV?$function@$$A6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@@ZEA=?default_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@3P6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@AEBV?$function@$$A6Q?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@@ZEA")

0 comments on commit c50b3a6

Please sign in to comment.