File: macro.c

package info (click to toggle)
cc65 2.19-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,268 kB
  • sloc: ansic: 117,151; asm: 66,339; pascal: 4,248; makefile: 1,009; perl: 607
file content (30 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
  !!DESCRIPTION!! macro bug test program
  !!ORIGIN!!      testsuite
  !!LICENCE!!     Public Domain
  !!AUTHOR!!      Groepaz/Hitmen
*/

#include <stdio.h>
#include <stdlib.h>

unsigned long fs=7;
unsigned long fd=5;
unsigned long a=3;

unsigned long _func(unsigned long x,unsigned long y)
{
        printf("x:%ld y:%ld\n",x,y);
        return 0;
}

#define func(x,y)       _func(x,y)

int main(void)
{
        fs= func( (fd/a) ,  func(2,0x0082c90f) );
        printf("fs:%ld\n",fs);
        fs=_func( (fd/a) , _func(2,0x0082c90f) );
        printf("fs:%ld\n",fs);
        return 0;
}