Skip to content

Commit

Permalink
libmd: fix build with gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Sep 26, 2024
1 parent f9f8759 commit 2a6d816
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 4 additions & 2 deletions devel/libmd/Portfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortSystem 1.0

name libmd
epoch 1
version 1.1.0
revision 0
categories devel
license BSD ISC Permissive
platforms darwin
maintainers {raimue @raimue} \
openmaintainer

Expand All @@ -30,3 +29,6 @@ checksums rmd160 1d8cfb5504ac71a50dc4c9372dee56fa721f5ac4 \
# hide away a bunch of generically-named header files
# see https://trac.macports.org/ticket/66832
configure.args --includedir=${prefix}/include/libmd

# https://trac.macports.org/ticket/70706
patchfiles-append patch-sha2.diff
18 changes: 18 additions & 0 deletions devel/libmd/files/patch-sha2.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- src/sha2.c 2023-04-09 18:24:46.000000000 +0800
+++ src/sha2.c 2024-09-27 05:04:13.000000000 +0800
@@ -280,13 +280,13 @@
context->bitcount[0] = 0;
}

-#ifdef libmd_strong_alias
+#if defined(libmd_strong_alias) && defined(__clang__)
libmd_strong_alias(SHA224Transform, SHA256Transform);
libmd_strong_alias(SHA224Update, SHA256Update);
libmd_strong_alias(SHA224Pad, SHA256Pad);
#else
void
-SHA224Transform(uint64_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH])
+SHA224Transform(uint32_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH])
{
SHA256Transform(state, data);
}

0 comments on commit 2a6d816

Please sign in to comment.