OK, so you're building it within the main Pg build system. Pg was successfully compiled, including files that use elog.h . Yet your extension doesn't compile, complaining about a macro/typedef conflict.
This makes me wonder: what's different?
Can you post the full sources of your extension, including the Makefile?
--
Craig Ringer
Here's the trimmed down version of the source and the Makefile (copied and modified from the 'cube' contrib project)
(with which I see the error related to redefinition)
/* myext.c */
#include <string.h>
#include <math.h>
#include "postgres.h"
#include "fmgr.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
PG_FUNCTION_INFO_V1(total_seconds);
PGDLLEXPORT Datum total_seconds(PG_FUNCTION_ARGS) {
PG_RETURN_INT64(0);
}
# Makefile
MODULE_big = myext
OBJS= myext.o
DATA_built = myext.sql
DATA = "">REGRESS = myext
SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/myext
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
myext.o: myext.c
clean:
rm -f myext.o