examples: use factory instead of macro. we don't know macro value

HAVE_FEATURE should be used in library internally for building the
library. Those macros are not provided for users. Users can choose a
FEATURE in runtime. If the FEATURE is compiled into library, then you
can.
some notes for id