git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Daniel Gurney <dgurney99@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] compat/bswap.h: detect ARM64 when using MSVC
Date: Sat, 7 Nov 2020 22:47:47 +0000	[thread overview]
Message-ID: <20201107224747.GF6252@camp.crustytoothpaste.net> (raw)
In-Reply-To: <20201107221916.1428757-1-dgurney99@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

On 2020-11-07 at 22:19:16, Daniel Gurney wrote:
> Signed-off-by: Daniel Gurney <dgurney99@gmail.com>
> ---
>  compat/bswap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/compat/bswap.h b/compat/bswap.h
> index c0bb744adc..512f6f4b99 100644
> --- a/compat/bswap.h
> +++ b/compat/bswap.h
> @@ -74,7 +74,7 @@ static inline uint64_t git_bswap64(uint64_t x)
>  }
>  #endif
>  
> -#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
> +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64))
>  
>  #include <stdlib.h>
>  

I think this is fine as it is, but I have a question here: why, if we're
using MSVC, is that not sufficient to enable this?  In other words, why
can't this line simply be this:

  #elif defined(_MSC_VER)

As far as I know, Windows has always run on little-endian hardware.  It
looks like MSVC did run on the M68000 series and MIPS[0] at some point.
Are those really versions of MSVC we care about and think Git can
practically support, given the fact that we require so many C99
constructs that are not practically available in old versions of MSVC?
If not, wouldn't it make sense to simplify?

[0] Wikipedia does not specify the endiannesses supported by the MIPS
edition.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2020-11-07 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 22:19 [PATCH] compat/bswap.h: detect ARM64 when using MSVC Daniel Gurney
2020-11-07 22:47 ` brian m. carlson [this message]
2020-11-07 23:23   ` Daniel Gurney
2020-11-10 13:58   ` Johannes Schindelin
2020-11-10 16:44     ` Sebastian Schuberth
2020-11-10 23:38     ` brian m. carlson

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=20201107224747.GF6252@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dgurney99@gmail.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).