forked from coccinelle/coccinelle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
standard.h
787 lines (569 loc) · 21.8 KB
/
standard.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
// clone: yacfe(master), coccinelle, acomment,
// ****************************************************************************
// Prelude, this file is to be used with the -macro_file option of the C parser
// ****************************************************************************
/* This file contains:
* - macros found in <.h>
* - macros found in .c; macros that cannot be parsed.
* In the future should be autodetected
* (not so easy to do same for macros in .h cos require to access .h file)
* - macros found in ".h"
* but where we cant detect that it will be a "bad macro"
* - macros found in .c; macros correctly parsed
* but where we cant detect that it will be a "bad macro"
*
* Some of those macros could be deleted and the C code rewritten because
* they are "bad" macros.
*
* todo? perhaps better if could enable/disable some of those expansions
* as different software may use conflicting macros.
*
*
* can maybe have a look in sparse/lib.c to see a list of default #define
* handled builtin apparently by gcc.
*/
// ****************************************************************************
// Test macros
// ****************************************************************************
// #define FOO(a, OP, b) a OP b
// #define FOO(a,b) fn(a,b)
// ****************************************************************************
// Generic macros
// ****************************************************************************
// ****************************************************************************
// Yacc macros
// ****************************************************************************
#define YY_PROTO(x) x
#define yyconst const
// ****************************************************************************
// GNU Hello macros
// ****************************************************************************
#define __getopt_argv_const const
// ****************************************************************************
// Gcc (as in the source of gcc code) macros
// ****************************************************************************
// ****************************************************************************
// Linux macros
// ****************************************************************************
// ----------------------------------------------------------------------------
// Attributes. could perhaps generalize via "__.*"
// ----------------------------------------------------------------------------
#define __init
#define __exit
#define __user
#define __iomem
#define __initdata
#define __exitdata
#define __devinit
#define __devexit
#define __devinitdata
#define __cpuinit
#define __cpuinitdata
#define __init_or_module
#define __initdata_or_module
#define __pminit
#define __pminitdata
#define __cacheline_aligned
#define ____cacheline_aligned
#define __cacheline_aligned_in_smp
#define ____cacheline_aligned_in_smp
#define ____cacheline_internodealigned_in_smp
#define __ALIGNED__
#define __3xp_aligned
#define __pmac
#define __force
#define __nocast
#define __read_mostly
#define __must_check
// pb
#define __unused
#define __maybe_unused
#define __attribute_used__
#define __attribute_pure__
#define __attribute_const__
// #define _attribute__const __attribute__((const))
#define __always_inline
#define __xipram
// in the other part of the kernel, in arch/, mm/, etc
#define __sched
#define __initmv
#define __exception
#define __cpuexit
#define __kprobes
#define __meminit
#define __meminitdata
#define __nosavedata
#define __kernel
#define __nomods_init
#define __apicdebuginit
#define __ipc_init
#define __modinit
#define __lockfunc
#define __weak
#define __tlb_handler_align
#define __lock_aligned
#define __force_data
#define __nongprelbss
#define __nongpreldata
#define __noreturn
#define __section_jiffies
#define __vsyscall_fn
#define __section_vgetcpu_mode
#define __section_vsyscall_gtod_data
// in header files
#define __bitwise
#define __bitwise__
#define __deprecated
// last found
#define __init_refok
// maybe only in old kernel
#define __openfirmware
#define __extension__
#define __thread
#define __used
#define __pure
#define __ref
#define __refdata
#define __uses_jump_to_uncached
// ----------------------------------------------------------------------------
// String macros
// ----------------------------------------------------------------------------
/* string macro. normally handle quite well by mu lalr(k), but
* sometimes not enough, if have for instance the XX YY case, could
* be considered as a declaration with XX being a typedef, so would
* Have ambiguity. So at least by adding this special case, we can
* catch more correct string-macro, no more a XX YY but now a good
* "XX" YY
*
* cf include/linux/kernel.h
*
* For stringification I need to have at least a witness, a string,
* and sometimes have just printk(KERN_WARNING MYSTR) and it could
* be transformed in a typedef later, so better to at least
* transform in string already the string-macro we know.
*
* Perhaps better to apply also as soon as possible the
* correct macro-annotation tagging (__init & co) to be able to
* filter them as soon as possible so that they will not polluate
* our pattern-matching that come later.
*/
#define KERN_EMERG "KERN_EMERG"
#define KERN_ALERT "KERN_ALERT"
#define KERN_CRIT "KERN_CRIT"
#define KERN_ERR "KERN_ERR"
#define KERN_WARNING "KERN_WARNING"
#define KERN_NOTICE "KERN_NOTICE"
#define KERN_INFO "KERN_INFO"
#define KERN_DEBUG "KERN_DEBUG"
/* EX_TABLE & co.
*
* Replaced by a string. We can't put everything as comment
* because it can be part of an expression where we wait for
* something, where we wait for a string. So at least we
* must keep the EX_TABLE token and transform it as a string.
*
* normally not needed if have good stringification of macro
* but those macros are sometimes used multiple times
* as in EX_TABLE(0b) EX_TABLE(1b) and we don't detect
* it well yet.
*/
// TODO don't use x :(
#define EX_TABLE(x) "TOTO"
#define ASM_EXCEPTIONTABLE_ENTRY(x) "TOTO"
#define DCACHE_CLEAR(x) "TOTO"
#define PPC405_ERR77(x) "TOTO"
// ----------------------------------------------------------------------------
// Alias keywords
// ----------------------------------------------------------------------------
// pb, false positive, can also be a #define cst and use as 'case CONST:'
//#define CONST const
#define STATIC static
#define _static static
#define noinline
#define __CS4231_INLINE__ inline
#define CCIO_INLINE inline
#define SBA_INLINE inline
#define STATIC_INLINE static inline
#define __EXTERN_INLINE extern inline
#define AGPEXTERN extern
#define PNMI_STATIC static
#define RLMT_STATIC static
#define SISINITSTATIC static
#define SCTP_STATIC static
#define BUGLVL if
#define IFDEBUG if
#define TRACE_EXIT return
// ----------------------------------------------------------------------------
// linkage
// ----------------------------------------------------------------------------
#define fastcall
#define asmlinkage
#define far
#define SK_FAR
// pb
//#define near
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#define INITSECTION
#define NORET_TYPE
#define compat_init_data
#define DIVA_EXIT_FUNCTION
#define DIVA_INIT_FUNCTION
#define ACPI_SYSTEM_XFACE
#define ASC_INITDATA
#define in2000__INITDATA
#define PACKED
#define WPMINFO
#define CPMINFO
#define PMINFO
#define ACPI_INTERNAL_VAR_XFACE
#define SISIOMEMTYPE
#define ACPI_STATE_COMMON
#define ACPI_PARSE_COMMON
#define ACPI_COMMON_DEBUG_MEM_HEADER
#define nabi_no_regargs
#define ATTRIB_NORET
#define ATTRIBUTE_UNUSED
#define BTEXT
#define BTDATA
#define PAGE_ALIGNED
#define EARLY_INIT_SECTION_ATTR
// pb
//#define INIT
#define IDI_CALL_ENTITY_T
#define IDI_CALL_LINK_T
/* cf gcc-linux.h
* A trick to suppress uninitialized variable warning without generating any
* code
*/
#define uninitialized_var(x) x = x
// as in u16 uninitialized_var(ioboard_type); /* GCC be quiet */
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#define __releases(x)
#define __acquires(x)
#define __declspec(x)
#define __page_aligned(x)
#define __vsyscall(x)
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//conflict with a macro of firefox
//#define FASTCALL(x) x
#define PARAMS(x) x
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// include/asm-arm/mach/arch.h
// #define MACHINE_START(x) struct foo { x }
#define MACHINE_START(_type,_name) \
static const struct machine_desc __mach_desc_##_type \
/* __used*/ \
__attribute__((__section__(".arch.info.init"))) = { \
.nr = MACH_TYPE_##_type, \
.name = _name,
#define MACHINE_END \
};
// include/asm-powerpc/machdep.h
#define define_machine(name) \
extern struct machdep_calls mach_##name; \
EXPORT_SYMBOL(mach_##name); \
struct machdep_calls mach_##name /*__machine_desc*/ =
// ----------------------------------------------------------------------------
// Declare like macros (in structure def), or tricky Declare macros
// ----------------------------------------------------------------------------
// include/asm-i386/pci.h
// the DECLARE are detected by parsing_hack but not when they are
// inside a struct def.
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
// defined in drivers/infiniband/hw/mthca/mthca_doorbell.h
#define MTHCA_DECLARE_DOORBELL_LOCK(doorbell_lock)
// include/linux/types.h
//#define BITS_TO_LONGS(bits) \
// (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
#define DECLARE_BITMAP(name,bits) \
/*unsigned*/ long name[BITS_TO_LONGS(bits)]
// include/asm-i386/percpu.h
// interesting macro where we see the need of __typeof__(type) with
// for example DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
#define DEFINE_PER_CPU(type, name) \
__attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
// include/linux/kobject.h
#define decl_subsys(_name,_type,_uevent_ops) \
struct subsystem _name##_subsys = { \
.kset = { \
.kobj = { .name = __stringify(_name) }, \
.ktype = _type, \
.uevent_ops =_uevent_ops, \
} \
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// pb: if use this macro then we will not transform the argument of CS_CHECK
// in some rules.
//#define CS_CHECK(fn, ret) \
// do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
// bt2/hci_bcsp.c
#define BCSP_CRC_INIT(x) x = 0xffff
// sound/oss/cs46xx_wrapper-24.h
#define CS_OWNER .owner =
#define CS_THIS_MODULE THIS_MODULE,
// sound/sparc/dbri.c
// "bad macro", have a ',' at the end
#define CS4215_SINGLE(xname, entry, shift, mask, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_cs4215_info_single, \
.get = snd_cs4215_get_single, .put = snd_cs4215_put_single, \
.private_value = entry | (shift << 8) | (mask << 16) | (invert << 24) },
// drivers/media/video/sn9c102/sn9c102_sensor.h
//#define sn9c102_write_const_regs(sn9c102_device, data...) \
// ({ const static u8 _valreg[][2] = {data}; \
// sn9c102_write_regs(sn9c102_device, _valreg, ARRAY_SIZE(_valreg)); })
// drivers/s390/cio/qdio.h
#define SYNC_MEMORY if (unlikely(q->siga_sync)) qdio_siga_sync_q(q)
#define SYNC_MEMORY_ALL if (unlikely(q->siga_sync)) \
qdio_siga_sync(q,~0U,~0U)
#define SYNC_MEMORY_ALL_OUTB if (unlikely(q->siga_sync)) \
qdio_siga_sync(q,~0U,0)
// drivers/scsi/g_NCR5380.c
#define ANDP ,
// drivers/scsi/ncr53c8xx.c
// generate lots of errors because error en cascade car dans l'initialiseur
// il y'a des '}' dans la premiere colonne
#define PREFETCH_FLUSH SCR_CALL, PADDRH (wait_dma),
// drivers/net/e100.c
// pbs false positive, defined in another manner in some files
//#define X(a,b) a,b
// net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
// also used in other.c that don't do any include :(
// but locally redefined in drivers/net/bnx2.c :( with a
// #define FNAME 0x8
#define FNAME(name) name,
// drivers/net/tulip/de4x5.c
#define DESC_ALIGN
// in .h
#define MPI_POINTER *
// mega4/soc.c mega4/socal.c
// cause false typedef inference if let soc_printk
#define soc_printk printk
#define socal_printk printk
// ----------------------------------------------------------------------------
// Initializer array macros
// ----------------------------------------------------------------------------
// drivers/net/wireless/bcm43xx/bcm43xx_wx.c
// defined in similar way multiple times, in the same file and in another one
#define WX(ioctl) [(ioctl) - SIOCSIWCOMMIT]
// #define WX(x) [(x)-SIOCIWFIRST]
// drivers/net/wireless/ipw2200.c
#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT]
// drivers/net/wireless/zd1211rw/zd_netdev.c
#define PRIV_OFFSET(x) [(x)-SIOCIWFIRSTPRIV]
// drivers/net/wireless/zd1211rw/zd_rf.h
#define RF_CHANNEL(ch) [(ch)-1]
// drivers/net/wireless/zd1211rw/zd_rf_uw2453.c
#define RF_CHANPAIR(a,b) [CHAN_TO_PAIRIDX(a)]
// drivers/net/wireless/arlan-proc.c
// incomplete macro, the real macro is quite complex and use other macros
#define ARLAN_SYSCTL_TABLE_TOTAL(x)
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// drivers/net/cxgb3/t3_hw.c
#define VPD_ENTRY(name, len) \
u8 name##_kword[2]; u8 name##_len; u8 name##_data[len]
// #define rtrc(i) {}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// drivers/video/nvidia/nv_type.h
// use: SetBitField(h_blank_e, 5: 5, 7:7)
//#define BITMASK(t,b) (((unsigned)(1U << (((t)-(b)+1)))-1) << (b))
//#define MASKEXPAND(mask) BITMASK(1?mask,0?mask)
//#define SetBF(mask,value) ((value) << (0?mask))
//#define GetBF(var,mask) (((unsigned)((var) & MASKEXPAND(mask))) >> (0?mask) )
//#define SetBitField(value,from,to) SetBF(to, GetBF(value,from))
//#define SetBit(n) (1<<(n))
//#define Set8Bits(value) ((value)&0xff)
// drivers/video/sis/init.c
// use: GETBITSTR((SiS_Pr->CVTotal -2), 10:10, 0:0)
//#define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l))
//#define GENMASK(mask) BITMASK(1?mask,0?mask)
//#define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0?mask))
//#define GETBITSTR(val,from,to) ((GETBITS(val,from)) << (0?to))
// fs/afs/internal.h
#define ASSERTCMP(X, OP, Y) \
do { \
if (unlikely(!((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "AFS: Assertion failed\n"); \
printk(KERN_ERR "%lu " /*#OP*/ " %lu is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
printk(KERN_ERR "0x%lx " /*#OP*/ " 0x%lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
BUG(); \
} \
} while(0)
#define ASSERTIFCMP(C, X, OP, Y) \
do { \
if (unlikely((C) && !((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "AFS: Assertion failed\n"); \
printk(KERN_ERR "%lu " /*#OP*/ " %lu is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
printk(KERN_ERR "0x%lx " /*#OP*/ " 0x%lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
BUG(); \
} \
} while(0)
#define ASSERTRANGE(L, OP1, N, OP2, H) \
do { \
if (unlikely(!((L) OP1 (N)) || !((N) OP2 (H)))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "AFS: Assertion failed\n"); \
printk(KERN_ERR "%lu "/*#OP1*/" %lu "/*#OP2*/" %lu is false\n", \
(unsigned long)(L), (unsigned long)(N), \
(unsigned long)(H)); \
printk(KERN_ERR "0x%lx "/*#OP1*/" 0x%lx "/*#OP2*/" 0x%lx is false\n", \
(unsigned long)(L), (unsigned long)(N), \
(unsigned long)(H)); \
BUG(); \
} \
} while(0)
// loop, macro without ';', single macro. ex: DEBUG()
// TODO should find the definition because we don't use 'x' and so
// may lose code sites with coccinelle. If expand correctly, will
// still don't transform correctly but at least will detect the place.
// Cooperation with parsing_hack.ml: MACROSTATEMENT is a magic string.
// I can't just expand those macros into some 'whatever();' because I need
// to generate a TMacroStmt for solving some ambiguities in the grammar
// for the toplevel stuff I think.
#define ASSERT(x) MACROSTATEMENT
#define IRDA_ASSERT(x) MACROSTATEMENT
#define CHECK_NULL(x) MACROSTATEMENT
//#define DEBUG(x) MACROSTATEMENT
#define DEBUG0(x) MACROSTATEMENT
#define DEBUG1(x) MACROSTATEMENT
#define DEBUG2(x) MACROSTATEMENT
#define DEBUG3(x) MACROSTATEMENT
#define DBG(x) MACROSTATEMENT
#define DEB(x) MACROSTATEMENT
#define PARSEDEBUG(x) MACROSTATEMENT
#define DEBC(x) MACROSTATEMENT
#define DBG_TRC(x) MACROSTATEMENT
#define DBG_ERR(x) MACROSTATEMENT
#define DBG_FTL(x) MACROSTATEMENT
#define DBGINFO(x) MACROSTATEMENT
#define DFLOW(x) MACROSTATEMENT
#define DFLIP(x) MACROSTATEMENT
#define DLOG_INT_TRIG(x) MACROSTATEMENT
#define D3(x) MACROSTATEMENT
#define D1(x) MACROSTATEMENT
#define DB(x) MACROSTATEMENT
#define DCBDEBUG(x) MACROSTATEMENT
#define SCSI_LOG_MLQUEUE(x) MACROSTATEMENT
#define PLND(x) MACROSTATEMENT
#define FCALND(x) MACROSTATEMENT
#define FCALD(x) MACROSTATEMENT
#define DEBUGRECURSION(x) MACROSTATEMENT
#define DEBUGPIO(x) MACROSTATEMENT
#define VDEB(x) MACROSTATEMENT
#define READ_UNLOCK_IRQRESTORE(x) MACROSTATEMENT
#define TRACE_CATCH(x) MACROSTATEMENT
#define PDBGG(x) MACROSTATEMENT
#define IF_ABR(x) MACROSTATEMENT
#define IF_EVENT(x) MACROSTATEMENT
#define IF_ERR(x) MACROSTATEMENT
#define IF_CBR(x) MACROSTATEMENT
#define IF_INIT(x) MACROSTATEMENT
#define IF_RX(x) MACROSTATEMENT
#define SOD(x) MACROSTATEMENT
#define KDBG(x) MACROSTATEMENT
#define IRDA_ASSERT_LABEL(x) MACROSTATEMENT
// ----------------------------------------------------------------------------
// Difficult foreach
// ----------------------------------------------------------------------------
// include/linux/sched.h
#define while_each_thread(g, t) \
while ((t = next_thread(t)) != g)
// net/decnet/dn_fib.c
#define for_fib_info() { struct dn_fib_info *fi;\
for(fi = dn_fib_info_list; fi; fi = fi->fib_next)
#define endfor_fib_info() }
#define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)
#define change_nexthops(fi) { int nhsel; struct dn_fib_nh *nh;\
for(nhsel = 0, nh = (struct dn_fib_nh *)((fi)->fib_nh); nhsel < (fi)->fib_nhs; nh++, nhsel++)
#define endfor_nexthops(fi) }
// ----------------------------------------------------------------------------
// Macros around function prototype
// ----------------------------------------------------------------------------
// net/sched/em_meta.c
#define META_COLLECTOR(FUNC) static void meta_##FUNC(struct sk_buff *skb, \
struct tcf_pkt_info *info, struct meta_value *v, \
struct meta_obj *dst, int *err)
#define GDTH_INITFUNC(x,y) x y
#define ASC_INITFUNC(x,y) x y
// ----------------------------------------------------------------------------
// If-like macros
// ----------------------------------------------------------------------------
// include/linux/lockd/debug.h
// include/linux/nfs_fs.h
// include/linux/nfsd/debug.h
// include/linux/sunrpc/debug.h
//#define ifdebug(flag) if (unlikely(nlm_debug & NLMDBG_##flag))
#define ifdebug(flag) if (0)
// ----------------------------------------------------------------------------
//#define __PROM_O32
// ----------------------------------------------------------------------------
// for tests-big/ macros, may be obsolete now cos fixed in latest kernel
// ----------------------------------------------------------------------------
// rule10
//#define ACPI_MODULE_NAME(x)
// ****************************************************************************
// Httpd (apache) macros
// ****************************************************************************
#define AP_DECLARE(x) x
#define PROXY_DECLARE(x) x
#define CACHE_DECLARE(x) x
#define DBD_DECLARE_NONSTD(x) x
#define DAV_DECLARE(x) x
#define APU_DECLARE(x) x
#define APU_DECLARE_NONSTD(x) x
#define APR_DECLARE(x) x
#define AP_CORE_DECLARE(x) x
#define AP_DECLARE_NONSTD(x) x
#define AP_CORE_DECLARE_NONSTD(x) x
#define APR_OPTIONAL_FN_TYPE(x) x
#define DAV_DECLARE_NONSTD(x) x
#define APR_DECLARE_NONSTD(x) x
#define APU_DECLARE_DATA
#define APR_THREAD_FUNC
#define AP_DECLARE_DATA
#define PROXY_DECLARE_DATA
#define AP_MODULE_DECLARE_DATA
#define APR_DECLARE_DATA
#define APR_INLINE inline
#define EXPORT static
#define REGISTER register
#define MODSSL_D2I_SSL_SESSION_CONST const
#define MODSSL_D2I_X509_CONST const
#define MODSSL_D2I_PrivateKey_CONST const
#define MODSSL_D2I_SSL_SESSION_CONST const
#define STACK_OF(X509_NAME) X509_NAME
#define MODSSL_PCHAR_CAST (pchar)
#define WINAPI
//#define CALLBACK
// generate false positive in Linux
#define APIENTRY
#define __declspec(x)
#define __stdcall
//#define module struct xxx
#define APR_POOL_IMPLEMENT_ACCESSOR(shm)
#define ADD_SUITE(suite) suite;
// ****************************************************************************
// CISCO vpn client macros
// ****************************************************************************
// #define NOREGPARM
// #define IN
// #define OUT
// #define OPTIONAL
#define likely(x) x
#define unlikely(x) x