Skip to content

Commit d382106

Browse files
committed
Comply better with C99 where GCC is not specified
1 parent d338534 commit d382106

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

test/regtest/test_c.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
#include <stdio.h>
33
#include <stdlib.h>
44
#include <string.h>
5+
#include <sys/types.h>
56

67
#ifndef putchar
78
#undef putchar
89
#endif
910

10-
asm (
11+
#ifndef __GNUC__
12+
#define __asm__ asm
13+
#endif
14+
15+
__asm__ (
1116
".globl entry\n"
1217
".set entry,0x0\n"
1318
);
@@ -69,12 +74,12 @@ __attribute__((__noinline__)) void triforce(ssize_t n)
6974
void data_func_2(void)
7075
{
7176
printf("invoked data_func()\n");
72-
asm volatile ("nop");
77+
__asm__ volatile ("nop");
7378
}
7479

7580
static void data_func(void)
7681
{
77-
asm volatile (
82+
__asm__ volatile (
7883
"xchg %r15, %r15\n"
7984
"callq data_func_2");
8085
}

0 commit comments

Comments
 (0)