Go back to the #ifdefs to work around compiler regressions.

While both gcc 12.2 and clang 18.0 compiled weak and non-weak versions
of the same symbol in the same file just fine, newer versions only work
if the weak symbol is in a different compilation unit than the non-weak
one. Otherwise they error out on the "redefinition".
This commit is contained in:
Rob Landley 2025-07-02 12:47:17 -05:00
parent 5ab6c0d5e2
commit 4bf4509984

View File

@ -57,7 +57,7 @@ void hash_by_name(int fd, char *name, char *result)
}
// Builtin implementations
#endif
#else
struct browns {
unsigned *rconsttable32;
@ -306,7 +306,7 @@ static void hash_update(char *data, unsigned int len,
}
}
__attribute__((__weak__)) void hash_by_name(int fd, char *name, char *result)
void hash_by_name(int fd, char *name, char *result)
{
unsigned long long count[2];
int i, chunksize, digestlen, method;
@ -391,3 +391,4 @@ __attribute__((__weak__)) void hash_by_name(int fd, char *name, char *result)
for (pp = (void *)libbuf; pp-(unsigned *)libbuf<sizeof(libbuf)/4; pp++)
*pp = 0;
}
#endif