git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat/bswap.h: detect ARM64 when using MSVC

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 7, 2020, 22:47 UTC
Message-ID
<20201107224747.GF6252@camp.crustytoothpaste.net>
In-Reply-To
<20201107221916.1428757-1-dgurney99@gmail.com>
On 2020-11-07 at 22:19:16, Daniel Gurney wrote:
Show 18 quoted lines
> 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
Previous: Daniel GurneyNext: Daniel Gurney
Message 2 of 6 in “compat/bswap.h: detect ARM64 when using MSVC”
  1. compat/bswap.h: detect ARM64 when using MSVCDaniel Gurney, Nov 7, 2020
  2. brian m. carlsonNov 7, 2020
  3. Daniel GurneyNov 7, 2020
  4. Johannes SchindelinNov 10, 2020
  5. Sebastian SchuberthNov 10, 2020
  6. brian m. carlsonNov 10, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.