]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / memset_ms.c
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
4 //
5 // This program and the accompanying materials are licensed and made
6 // available under the terms and conditions of the BSD License which
7 // accompanies this distribution. The full text of the license may be
8 // found at http://opensource.org/licenses/bsd-license.php
9 //
10 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
12 // IMPLIED.
13 //
14 //------------------------------------------------------------------------------
15
16 #if defined(_M_ARM64)
17 typedef unsigned __int64 size_t;
18 #else
19 typedef unsigned __int32 size_t;
20 #endif
21
22 void* memset(void *, int, size_t);
23 #pragma intrinsic(memset)
24 #pragma function(memset)
25 void *memset(void *s, int c, size_t n)
26 {
27 unsigned char *d = s;
28
29 while (n--)
30 *d++ = (unsigned char)c;
31
32 return s;
33 }