All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: git@vger.kernel.org
Cc: sandals@crustytoothpaste.net,
	"Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [PATCH 2/3] git-compat-util: define MIN through compat
Date: Sun, 21 Oct 2018 22:36:04 -0700	[thread overview]
Message-ID: <20181022053605.81048-3-carenas@gmail.com> (raw)
In-Reply-To: <20181022053605.81048-1-carenas@gmail.com>

this macro is commonly defined in system headers (usually <sys/param.h>)
but if it is not define it here so it can be used elsewhere

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 git-compat-util.h     | 5 +++++
 sha256/block/sha256.c | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 5f2e90932f..7a0b48452b 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -218,6 +218,11 @@
 #else
 #include <stdint.h>
 #endif
+
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#endif
+
 #ifdef NO_INTPTR_T
 /*
  * On I16LP32, ILP32 and LP64 "long" is the safe bet, however
diff --git a/sha256/block/sha256.c b/sha256/block/sha256.c
index 0d4939cc2c..5fba943c79 100644
--- a/sha256/block/sha256.c
+++ b/sha256/block/sha256.c
@@ -130,9 +130,6 @@ static void blk_SHA256_Transform(blk_SHA256_CTX *ctx, const unsigned char *buf)
 	}
 }
 
-#ifndef MIN
-#define MIN(x, y) ((x) < (y) ? (x) : (y))
-#endif
 void blk_SHA256_Update(blk_SHA256_CTX *ctx, const void *data, size_t len)
 {
 	const unsigned char *in = data;
-- 
2.19.1


  parent reply	other threads:[~2018-10-22  5:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22  5:36 [RFC/PATCH 0/3] refactor MIN macro Carlo Marcelo Arenas Belón
2018-10-22  5:36 ` [PATCH 1/3] sha256: avoid redefinition for MIN Carlo Marcelo Arenas Belón
2018-10-22  6:00   ` Junio C Hamano
2018-10-22  5:36 ` Carlo Marcelo Arenas Belón [this message]
2018-10-22  6:13   ` [PATCH 2/3] git-compat-util: define MIN through compat Junio C Hamano
2018-10-22  6:41     ` Carlo Arenas
2018-10-22  5:36 ` [PATCH 3/3] xdiff: use compat's MIN instead Carlo Marcelo Arenas Belón
2018-10-22  5:59   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181022053605.81048-3-carenas@gmail.com \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.