File: xcommon.h

package info (click to toggle)
vuos 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: ansic: 22,155; python: 284; makefile: 28; sh: 4
file content (14 lines) | stat: -rw-r--r-- 224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef XCOMMON_H
#define XCOMMON_H

/* xfree and xstrdup does not break if the argument is NULL */

#define xfree(ptr) do { \
	if (ptr) \
	free(ptr); \
} while(0)

#define xstrdup(ptr) \
	(ptr ? strdup(ptr) : NULL)

#endif