- 博客(12)
- 资源 (6)
- 收藏
- 关注
原创 Makefile 学习笔记(三)实例
1迷宫问题的工程实例 该工程包含三个头文件main.h、stack.h、maze.h,和三个源文件main.c、stack.c、maze.c。/*头文件main.h*/#ifndef MAIN_H#define MAIN_Htypedef struct point {int row, col;}item_t;#define MAX_ROW
2015-10-01 22:26:29 383
libev-4.15.tar.gz
libev-4.15 源码
libev是一个开源的事件驱动库,基于epoll,kqueue等OS提供的基础设施。其以高效出名,它可以将IO事件,定时器,和信号统一起来,统一放在事件处理这一套框架下处理。基于Reactor模式,效率较高,并且代码精简(4.15版本8000多行),是学习事件驱动编程的很好的资源。
2016-12-22
Posix多线程程序设计源码
Posix多线程程序设计书中实例源码。
头文件errors.h
#ifndef __errors_h
#define __errors_h
#include
#include
#include
#include
#include
/*
* Define a macro that can be used for diagnostic output from
* examples. When compiled -DDEBUG, it results in calling printf
* with the specified argument list. When DEBUG is not defined, it
* expands to nothing.
*/
#ifdef DEBUG
# define DPRINTF(arg) printf arg
#else
# define DPRINTF(arg)
#endif
/*
* NOTE: the "do {" ... "} while (0);" bracketing around the macros
* allows the err_abort and errno_abort macros to be used as if they
* were function calls, even in contexts where a trailing ";" would
* generate a null statement. For example,
*
* if (status != 0)
* err_abort (status, "message");
* else
* return status;
*
* will not compile if err_abort is a macro ending with "}", because
* C does not expect a ";" to follow the "}". Because C does expect
* a ";" following the ")" in the do...while construct, err_abort and
* errno_abort can be used as if they were function calls.
*/
#define err_abort(code,text) do { \
fprintf (stderr, "%s at \"%s\":%d: %s\n", \
text, __FILE__, __LINE__, strerror (code)); \
abort (); \
} while (0)
#define errno_abort(text) do { \
fprintf (stderr, "%s at \"%s\":%d: %s\n", \
text, __FILE__, __LINE__, strerror (errno)); \
abort (); \
} while (0)
#endif
2015-10-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人