utils/gz: Fix compilation on non-x86 archs

gen_crc_combine_table is now executed on every build, so it should not
fail on unsupported archs. The generated file will not contain data,
but this is fine since it should not be used.

Another problem is that u32 and u64 aliases were not visible in the #else
branch in crc_combine.cc
Message-Id: <1543864425-5650-1-git-send-email-tgrabiec@scylladb.com>

(cherry picked from commit 9a4c00beb7)
This commit is contained in:
Tomasz Grabiec
2018-12-03 20:13:45 +01:00
committed by Avi Kivity
parent 9d8507de09
commit af6d4f40e1
2 changed files with 13 additions and 6 deletions

View File

@@ -52,13 +52,13 @@
#include "crc_combine_table.hh"
#include "utils/clmul.hh"
using u32 = uint32_t;
using u64 = uint64_t;
#if defined(__x86_64__) || defined(__i386__)
#include "barett.hh"
using u32 = uint32_t;
using u64 = uint64_t;
/*
* Calculates:
*

View File

@@ -20,12 +20,13 @@
*
*/
#include <iostream>
#if defined(__x86_64__) || defined(__i386__)
#include "utils/clmul.hh"
#include "barett.hh"
#include <iostream>
#include <seastar/core/print.hh>
int main() {
@@ -73,8 +74,14 @@ int main() {
#else
int main() {
std::cerr << "Not implemented for this arch!\n";
return 1;
std::cout << "/*\n"
" * Generated with gen_crc_combine_table.cc\n"
" * DO NOT EDIT!\n"
" */\n"
"\n"
"/* Not implemented for this CPU architecture. */\n"
"\n";
return 0;
}
#endif