#ifdef file

Is there such as thing as Include it?

I.E.

#ifdef_file <my_header.h>
#include <my_header.h>
#endif

I just don’t want to get errors or warning if it does not exist.

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:

Is there such as thing as Include it?

I.E.

#ifdef_file <my_header.h
#include <my_header.h
#endif

I just don’t want to get errors or warning if it does not exist.

I don’t think so. People usually do this in like “config.h”.

#define HAVE_SYS_SELECT_H 1
#undef HAVE_SYS_POLL_H

And then

#include “config.h”

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

-xtang

I guess that the option I’ll use is to ignore that warning if it occurs. I
was hoping that there was something more portable.

And damn it, there should be! Who should I complain to? Just kidding.

“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:alb0la$422$1@nntp.qnx.com

“Bill Caroselli (Q-TPS)” <> QTPS@earthlink.net> > wrote:
Is there such as thing as Include it?

I.E.

#ifdef_file <my_header.h
#include <my_header.h
#endif

I just don’t want to get errors or warning if it does not exist.

I don’t think so. People usually do this in like “config.h”.

#define HAVE_SYS_SELECT_H 1
#undef HAVE_SYS_POLL_H

And then

#include “config.h”

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h
#endif

#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h
#endif

-xtang

“Bill Caroselli (Q-TPS)” <QTPS@EarthLink.net> wrote in message
news:alavu0$bs6$1@inn.qnx.com

Is there such as thing as Include it?

I.E.

#ifdef_file <my_header.h
#include <my_header.h
#endif

I just don’t want to get errors or warning if it does not exist.

Have your makefile handle it. For example if the file does not exits
it could just create an empty one (touch my_header.h)