M
mrbluelamp
I have two programs, ProgramA and ProgramB, they both use a common
header, well I am wanting to use a common header, if possible. This is
similiar to what I have, in ProgramA.h I have the code:
#if !defined(ProgramA)
#define ProgramA
The problem is, that it always goes into the #else section, am I
missing something?
//Rules.h
#if !defined(RULESIncluded)
#define RULESIncluded
#ifdef ProgramA
#include "Branch.h"
#include <vector>
class Rules
{
public:
Rules(char *iniFile);
~Rules();
static inline bool IsValid(char* text);
static Data* GetData(const char* name);
private:
static std::vector<Data*> names_vec;
};
#else
class Rules
{
public:
Rules();
~Rules();
static inline bool IsValid(char* text);
};
#endif
bool Rules::IsValid(char* text)
{
//Code Here
return true;
}
#endif
header, well I am wanting to use a common header, if possible. This is
similiar to what I have, in ProgramA.h I have the code:
#if !defined(ProgramA)
#define ProgramA
The problem is, that it always goes into the #else section, am I
missing something?
//Rules.h
#if !defined(RULESIncluded)
#define RULESIncluded
#ifdef ProgramA
#include "Branch.h"
#include <vector>
class Rules
{
public:
Rules(char *iniFile);
~Rules();
static inline bool IsValid(char* text);
static Data* GetData(const char* name);
private:
static std::vector<Data*> names_vec;
};
#else
class Rules
{
public:
Rules();
~Rules();
static inline bool IsValid(char* text);
};
#endif
bool Rules::IsValid(char* text)
{
//Code Here
return true;
}
#endif