Kohinoor24
May 29th, 2002, 01:57 AM
I have a project with these 2 classes & separate .cpp files for the function declarations.
#include<pthread.h>
class LinuxThread
{
public:
// Function Declarations
private:
pthread_t ThreadHandle;
}
#include <windows.h>
class WinThread
{
public:
// Function Declarations
private:
HANDLE ThreadHandle;
}
I have a "Reader" & "Writer" class also Which derives from either the "WinThread" class or "LinuxThread" class depending on the operating system.This Iam managing in my main() with #ifdef procedure
In my main() Function
I have the #ifdef declarations:
#ifdef _LINUX_
#endif
#ifdef _WIN_VER
#endif
I Have all these Linux specific files & windows specific files in a single project.My question is there any way,apart from #ifdef statements, by which I can compile & built the project without errors under windows or Linux without the winspecific files or Linux specific files causing errors.
ie:when Iam compiling this project under windows,I need some way so that Linux specific files doesnt get compiled & vice versa.
I dont want to use #ifdef statements ,because I have used it once in my project(In main()) & I dont want to use it more than once
Thanks
#include<pthread.h>
class LinuxThread
{
public:
// Function Declarations
private:
pthread_t ThreadHandle;
}
#include <windows.h>
class WinThread
{
public:
// Function Declarations
private:
HANDLE ThreadHandle;
}
I have a "Reader" & "Writer" class also Which derives from either the "WinThread" class or "LinuxThread" class depending on the operating system.This Iam managing in my main() with #ifdef procedure
In my main() Function
I have the #ifdef declarations:
#ifdef _LINUX_
#endif
#ifdef _WIN_VER
#endif
I Have all these Linux specific files & windows specific files in a single project.My question is there any way,apart from #ifdef statements, by which I can compile & built the project without errors under windows or Linux without the winspecific files or Linux specific files causing errors.
ie:when Iam compiling this project under windows,I need some way so that Linux specific files doesnt get compiled & vice versa.
I dont want to use #ifdef statements ,because I have used it once in my project(In main()) & I dont want to use it more than once
Thanks