Use __restrict rather than restrict in C code.
__restrict also works in MSVC.
Change-Id: Ia4ecd57c8fc55e358368c00279df9c55d6bc2dc2
diff --git a/c/swap.c b/c/swap.c
index 657ae9d..c646855 100644
--- a/c/swap.c
+++ b/c/swap.c
@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <string.h>
-void swap_loop(char* restrict a, char* restrict b, size_t len) {
+void swap_loop(char* __restrict a, char* __restrict b, size_t len) {
while (len--) {
char tmp = *a;
*a++ = *b;
@@ -11,7 +11,7 @@
};
}
-void swap_malloc(char* restrict a, char* restrict b, size_t len) {
+void swap_malloc(char* __restrict a, char* __restrict b, size_t len) {
char *temp = malloc(len);
memmove(temp,a,len);
memmove(a,b,len);
@@ -19,7 +19,7 @@
free(temp);
}
-void swap_alloca(char* restrict a, char* restrict b, size_t len) {
+void swap_alloca(char* __restrict a, char* __restrict b, size_t len) {
char temp[len];
memmove(temp,a,len);
memmove(a,b,len);