Basic edits for Linux portability

This commit is contained in:
Campbell Barton 2016-03-27 11:44:21 +11:00
parent 79d38796c4
commit 107701249b
24 changed files with 62 additions and 11 deletions

View file

@ -5,6 +5,10 @@
#include "ttzpimagefx.h"
#ifdef LINUX
#define strtok_s strtok_r
#endif
//**********************************************************************************************
// Global functions
//**********************************************************************************************

View file

@ -11,12 +11,14 @@
#ifndef __sgi
#ifdef WIN32
#include <GL/glut.h>
#elif defined(LINUX)
#include <GL/glut.h>
#else
#include <GLUT/glut.h>
#endif
#endif
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
#include <QGLContext>
#endif

View file

@ -9,7 +9,7 @@ extern "C" {
#include <stdio.h>
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
#include <stddef.h>
#endif

View file

@ -18,6 +18,9 @@
#elif MACOSX
#include <sys/sysctl.h>
#include <unistd.h>
#elif LINUX
#include <sys/time.h>
#include <unistd.h>
#endif
#include "tipc.h"

View file

@ -21,7 +21,9 @@
#include <dirent.h>
#include <sys/dir.h>
#include <sys/param.h> // for getfsstat
#ifdef MACOSX
#include <sys/ucred.h>
#endif
#include <sys/mount.h>
#include <pwd.h>
#include <dlfcn.h>
@ -63,7 +65,7 @@ typedef const TPluginInfo *TnzLibMainProcType();
namespace
{
const char *TnzLibMainProcName = "TLibMain";
#ifdef MACOSX
#if !defined(WIN32)
const char *TnzLibMainProcName2 = "_TLibMain";
#endif
}

View file

@ -186,6 +186,11 @@ bool TSystem::memoryShortage()
// to be done...
return false;
#elif defined(LINUX)
// to be done...
return false;
#else
@ @ @ERROR : PLATFORM NOT SUPPORTED

View file

@ -15,6 +15,10 @@
#include <set>
#ifdef LINUX
#include <typeinfo>
#endif
using namespace std;
namespace

View file

@ -97,7 +97,7 @@ extern "C" void CALLBACK myCombine(GLdouble coords[3], GLdouble *d[4],
typedef GLvoid(CALLBACK *GluCallback)(void);
#endif
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
typedef GLvoid (*GluCallback)();

View file

@ -97,6 +97,11 @@
* Platform Dependent Definitions and Typedefs *
****************************************************************************/
#ifdef LINUX
#include <wchar.h>
#endif
/* Microsoft C/C++ Compiler */
#if defined(WIN32) || defined(WIN64) || defined(_WINDOWS)
#define TWH_CMP_MSC

View file

@ -13,6 +13,10 @@ extern "C" {
#include <stddef.h>
#endif
#ifdef LINUX
#include <wchar.h>
#endif
char *convertWCHAR2CHAR(const wchar_t *fname);
#if defined(MACOSX) || defined(LINUX)

View file

@ -13,6 +13,8 @@
#include <GL/glu.h>
#elif MACOSX
#include <GLUT/glut.h>
#elif LINUX
#include <GL/glut.h>
#endif
#ifndef TCG_GLU_CALLBACK

View file

@ -18,7 +18,7 @@ typedef uint32_t TUINT32;
typedef int64_t TINT64;
typedef uint64_t TUINT64;
#elif defined(__LP64__)
#elif defined(__LP64__) && (!defined(LINUX))
#define TINT32 \
; \

View file

@ -154,6 +154,8 @@ public:
Channel b, g, r, m;
#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
Channel m, r, g, b;
#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
Channel r, g, b, m;
#else
undefined machine order !!!!
#endif

View file

@ -162,9 +162,9 @@ public:
//----------------------------------------------------------------------------
//!Applies a trasformation (echo, reverb, ect) to the object and returns the transformed soundtrack
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
TSoundTrackP apply(TSoundTransform *transform);
#else
#else // WIN32
TSoundTrackP apply(TSoundTransform *transform)
{
assert(transform);

View file

@ -35,7 +35,7 @@ void DVAPI shutdown();
class ExecutorId; //Private
class Runnable;
#ifndef MACOSX
#if !(defined(MACOSX) || defined(LINUX))
template class TSmartPointerT<Runnable>;
#endif
typedef TSmartPointerT<Runnable> RunnableP;

View file

@ -2,6 +2,7 @@
#include <stdexcept> /* std::domain_error(-) */
#include <limits> /* std::numeric_limits */
#include <cmath> /* pow(-),abs(-) */
#include <cstring> /* memmove */
#include "igs_ifx_common.h" /* igs::image::rgba */
#include "igs_motion_blur.h"

View file

@ -1,4 +1,5 @@
#include <cerrno>
#include <cstring> /* memset */
#include <vector>
#include <stdexcept> // std::domain_error(-)
#include <locale>

View file

@ -2,6 +2,10 @@
#include "tscannerutil.h"
#ifdef LINUX
#include <cstring>
#endif
#define BUFBYTE(X, Y, BUF, BYTEWRAP, BITOFFS) \
(((UCHAR *)(BUF))[(((X) + (BITOFFS)) >> 3) + (Y) * (BYTEWRAP)])

View file

@ -12,6 +12,10 @@
#include "ext/plasticdeformer.h"
#if defined(LINUX)
#include <cstring>
#endif
/*! \file plasticdeformer.cpp
This file contains the implementation of a Mesh Deformer as specified in the

View file

@ -18,6 +18,10 @@ using namespace tcg::bgl;
#include "ext/plastichandle.h"
#if defined(LINUX)
#include <cstring>
#endif
//***********************************************************************************************
// Distance building
//***********************************************************************************************

View file

@ -4,6 +4,10 @@
#include <stdlib.h>
#include <memory>
#if defined(LINUX)
#include <cstring>
#endif
//blasint may either be common 4 bytes or extended 8 (long)...
//Replace this and REBUILD the CBLAS with extended int if needed.
typedef int blasint;

View file

@ -17,7 +17,7 @@
#include <QSettings>
// MACOSX includes
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
#include <netdb.h> // gethostbyname
#include <arpa/inet.h> // inet_ntoa
#endif

View file

@ -14,7 +14,7 @@ fare resize e realloc size dello stack a 65000 unita'
*/
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
#define TRUE 1
#define FALSE 0
#endif

View file

@ -15,7 +15,7 @@
#include "tmsg.h"
#include "copP.h"*/
#ifdef MACOSX
#if defined(MACOSX) || defined(LINUX)
#define TRUE 1
#define FALSE 0
#endif