我们在pixman直接查找pixman_region32_init实现会找不到,原因在于PREFIX宏
1、在pixman-region32.c和pixman-region16.c有很大关系,以pixman-region32.c为例
#ifdef HAVE_CONFIG_H
#include <pixman-config.h>
#endif
#include "pixman-private.h"
#include <stdlib.h>
typedef pixman_box32_t box_type_t;
typedef pixman_region32_data_t region_data_type_t;
typedef pixman_region32_t region_type_t;
typedef int64_t overflow_int_t;
typedef struct {
int x, y;
} point_type_t;
#define PREFIX(x) pixman_region32##x
#define PIXMAN_REGION_MAX INT32_MAX
#define PIXMAN_REGION_MIN INT32_MIN
#include "pixman-region.c"
原因就在于:
PREFIX(x)宏的展开
2、pixman_region32_init的真正实现函数就在这里
PIXMAN_EXPORT void
PREFIX (_init) (region_type_t *region)
{
region->extents = *pixman_region_empty_box;
region->data = pixman_region_empty_data;
}