1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0022972: Eliminate macro definitions that has compiler-provided analogs (WNT and so on)

1) Macro definition WNT replaced by _WIN32 and _MSC_VER for platform and compiler detection accordingly.
2) Macro definition LIN replaced by __linux__ macro.
3) Macro definition DEB replaced by OCCT_DEBUG macro.
This commit is contained in:
akz
2015-09-15 17:46:43 +03:00
committed by kgv
parent 28a73c1fe7
commit 57c28b6122
180 changed files with 370 additions and 411 deletions

View File

@@ -14,7 +14,7 @@
commercial license or contractual agreement.
*/
#ifdef WNT
#ifdef _WIN32
#define COMMANDCLASS "COMMANDWINDOW"

View File

@@ -14,7 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#define COMMANDCLASS "COMMANDWINDOW"

View File

@@ -76,7 +76,7 @@ Standard_EXPORT Standard_Boolean Draw_Interprete(const char* command);
// *******************************************************************
// read an init file
// *******************************************************************
#ifdef WNT
#ifdef _WIN32
extern console_semaphore_value volatile console_semaphore;
extern char console_command[1000];
#endif
@@ -84,7 +84,7 @@ extern char console_command[1000];
static void ReadInitFile (const TCollection_AsciiString& theFileName)
{
TCollection_AsciiString aPath = theFileName;
#ifdef WNT
#ifdef _WIN32
if (!Draw_Batch) {
try {
aPath.ChangeAll ('\\', '/');
@@ -104,7 +104,7 @@ static void ReadInitFile (const TCollection_AsciiString& theFileName)
Sprintf (com, "source %s", aPath.ToCString());
Draw_Interprete (com);
delete [] com;
#ifdef WNT
#ifdef _WIN32
}
#endif
}
@@ -123,7 +123,7 @@ Handle(Draw_ProgressIndicator) Draw::GetProgressBar()
return PInd;
}
#ifndef WNT
#ifndef _WIN32
/*--------------------------------------------------------*\
| exitProc: finalization handler for Tcl/Tk thread. Forces parent process to die
\*--------------------------------------------------------*/
@@ -254,12 +254,12 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
// *****************************************************************
// init X window and create display
// *****************************************************************
#ifdef WNT
#ifdef _WIN32
HWND hWnd = NULL;
#endif
if (!Draw_Batch)
#ifdef WNT
#ifdef _WIN32
Draw_Batch=!Init_Appli(hInst, hPrevInst, nShow, hWnd);
#else
Draw_Batch=!Init_Appli();
@@ -294,7 +294,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
// *****************************************************************
Draw_InitAppli(theCommands);
#ifndef WNT
#ifndef _WIN32
Tcl_CreateExitHandler(exitProc, 0);
#endif
@@ -307,7 +307,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
{
if (getenv ("CASROOT") == NULL)
{
#ifdef WNT
#ifdef _WIN32
ReadInitFile ("ddefault");
#else
cout << " the CASROOT variable is mandatory to Run OpenCascade "<< endl;
@@ -331,7 +331,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
ReadInitFile (aRunFile);
// provide a clean exit, this is useful for some analysis tools
if ( ! isInteractiveForced )
#ifndef WNT
#ifndef _WIN32
return;
#else
ExitProcess(0);
@@ -343,7 +343,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
Draw_Interprete (aCommand.ToCString());
// provide a clean exit, this is useful for some analysis tools
if ( ! isInteractiveForced )
#ifndef WNT
#ifndef _WIN32
return;
#else
ExitProcess(0);
@@ -354,7 +354,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
// X loop
// *****************************************************************
if (XLoop) {
#ifdef WNT
#ifdef _WIN32
Run_Appli(hWnd);
#else
Run_Appli(Draw_Interprete);
@@ -372,7 +372,7 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
cmd[i] = '\0';
} while (Draw_Interprete(cmd) != (unsigned int ) -2);
}
#ifdef WNT
#ifdef _WIN32
// Destruction de l'application
Destroy_Appli(hInst);
#endif
@@ -491,11 +491,11 @@ void Draw::Load(Draw_Interpretor& theDI, const TCollection_AsciiString& theKey,
}
TCollection_AsciiString aPluginLibrary("");
#ifndef WNT
#ifndef _WIN32
aPluginLibrary += "lib";
#endif
aPluginLibrary += aPluginResource->Value(theKey.ToCString());
#ifdef WNT
#ifdef _WIN32
aPluginLibrary += ".dll";
#elif __APPLE__
aPluginLibrary += ".dylib";

View File

@@ -14,7 +14,7 @@
commercial license or contractual agreement.
*/
#ifdef WNT
#ifdef _MSC_VER
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.

View File

@@ -29,7 +29,7 @@
typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
//extern void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int);
Standard_EXPORT void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int,
@@ -41,7 +41,7 @@ extern void Draw_Appli(Standard_Integer argc, char** argv,
#if defined(WNT) && !defined(HAVE_NO_DLL)
#if defined(_WIN32) && !defined(HAVE_NO_DLL)
#ifndef __Draw_API
# ifdef __Draw_DLL
# define __Draw_API __declspec ( dllexport )
@@ -54,7 +54,7 @@ extern void Draw_Appli(Standard_Integer argc, char** argv,
#endif
#ifndef WNT
#ifndef _WIN32
extern Draw_Viewer dout;
extern Standard_Boolean Draw_Batch;
#endif

View File

@@ -27,9 +27,7 @@
static Standard_Real MinimumStep = 1.e-3 ;
static Standard_Real Ratio = 200.0 ;
//#ifdef WNT
extern Draw_Viewer dout;
//#endif
//=======================================================================
// Function : Draw_Grid

View File

@@ -198,7 +198,7 @@ static Standard_Integer CommandCmd
cout << "An exception was caught " << E << endl;
if (cc && Draw::Atoi(cc)) {
#ifdef WNT
#ifdef _WIN32
Tcl_Exit(0);
#else
Tcl_Eval(interp,"exit");
@@ -566,7 +566,7 @@ Draw_Interpretor::~Draw_Interpretor()
#endif
}
#else
#ifdef WNT
#ifdef _WIN32
Tcl_Exit(0);
#endif
#endif

View File

@@ -53,7 +53,7 @@
#include <tcl.h>
#ifdef WNT
#ifdef _WIN32
#include <sys/stat.h>
#include <Draw_Window.hxx>
@@ -78,7 +78,7 @@ Standard_IMPORT Standard_Boolean Draw_Interprete(const char* command); //for C30
static FDraw_InitAppli theDraw_InitAppli; //pointer to the Draw_InitAppli
#endif
#ifdef WNT
#ifdef _WIN32
//=======================================================================
//NOTE: OCC11
// On Windows NT, both console (UNIX-like) and windowed (classical on

View File

@@ -30,7 +30,7 @@
typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
#ifndef WNT
#ifndef _WIN32
Standard_EXPORT Standard_Integer _main_ (Standard_Integer argc,
Standard_PCharacter argv[],
const FDraw_InitAppli Draw_InitAppli);
@@ -49,7 +49,7 @@ Standard_EXPORT Standard_Integer _main_ (int argc,
#endif
// Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
#ifndef WNT
#ifndef _WIN32
// main()
#define DRAW_MAIN int main (Standard_Integer argc, char* argv[])\
{return _main_ (argc, argv, Draw_InitAppli);}

View File

@@ -114,7 +114,7 @@ void Draw_Viewer::MakeView(const Standard_Integer id,
}
}
#ifdef WNT
#ifdef _WIN32
//=======================================================================
//function : MakeView
//purpose :
@@ -590,7 +590,7 @@ void Draw_Viewer::RepaintView (const Standard_Integer id) const
}
#ifdef WNT
#ifdef _WIN32
//=======================================================================
//function : ResizeView
//purpose : WNT re-drawing optimization

View File

@@ -29,7 +29,7 @@
#include <Draw_SequenceOfDrawable3D.hxx>
#include <Draw_Color.hxx>
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#if !defined(__Draw_API) && !defined(HAVE_NO_DLL)
# ifdef __Draw_DLL
@@ -56,7 +56,7 @@ class Draw_Viewer {
const Standard_Integer X, const Standard_Integer Y,
const Standard_Integer W, const Standard_Integer H);
// build a view on a given window
#ifdef WNT
#ifdef _WIN32
__Draw_API void MakeView (const Standard_Integer id,
const char* typ,
const Standard_Integer X, const Standard_Integer Y,
@@ -108,7 +108,7 @@ class Draw_Viewer {
__Draw_API void ClearView (const Standard_Integer id) const;
__Draw_API void RemoveView (const Standard_Integer id) ;
__Draw_API void RepaintView (const Standard_Integer id) const;
#ifdef WNT
#ifdef _WIN32
__Draw_API void ResizeView (const Standard_Integer id) const;
__Draw_API void UpdateView (const Standard_Integer id, const Standard_Boolean forced = Standard_False) const;
#endif

View File

@@ -15,7 +15,7 @@
// commercial license or contractual agreement.
// include windows.h first to have all definitions available
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#endif

View File

@@ -19,7 +19,7 @@
/** MainWindow.h
*/
/*\****************************************************/
#ifdef WNT
#ifdef _WIN32
#define CLIENTWND 0

View File

@@ -14,7 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#include <DrawRessource.h>

View File

@@ -14,7 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef WNT
#ifdef _WIN32
// include windows.h first to have all definitions available
#include <windows.h>

View File

@@ -14,7 +14,7 @@
commercial license or contractual agreement.
*/
#ifdef WNT
#ifdef _WIN32
#define APPCLASS "TDRAW"
#define APPTITLE "Windows NT TDRAW"