Skip to content

Commit

Permalink
adding fix for building OpenSeesPy in Debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
aschellenberg74 committed Oct 29, 2024
1 parent 96ec048 commit ff9c709
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
10 changes: 10 additions & 0 deletions SRC/reliability/domain/distributions/PythonRV.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@
#ifndef PythonRV_h
#define PythonRV_h

#ifdef _WIN32
#include <corecrt.h>
#endif

#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif

#include <RandomVariable.h>

Expand Down
4 changes: 2 additions & 2 deletions SRC/reliability/domain/functionEvaluator/PythonEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PythonEvaluator::PythonEvaluator(
current_val(0),
moduleName() {
theExpression = 0;
int exprLen = strlen(passed_fileName);
int exprLen = (int)strlen(passed_fileName);
fileName = new char[exprLen + 1];
strcpy(fileName, passed_fileName);
}
Expand Down Expand Up @@ -145,7 +145,7 @@ int PythonEvaluator::setVariables() {
int PythonEvaluator::setExpression(const char *passedExpression) {
if (theExpression != 0) delete[] theExpression;

int exprLen = strlen(passedExpression);
int exprLen = (int)strlen(passedExpression);
theExpression = new char[exprLen + 1];
strcpy(theExpression, passedExpression);

Expand Down
13 changes: 12 additions & 1 deletion SRC/reliability/domain/functionEvaluator/PythonEvaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@
#ifndef PythonEvaluator_h
#define PythonEvaluator_h

#ifdef _WIN32
#include <corecrt.h>
#endif

#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif

#include <Domain.h>
#include <FunctionEvaluator.h>
#include <Python.h>
#include <ReliabilityDomain.h>
#include <vector>
#include <string>
Expand Down

0 comments on commit ff9c709

Please sign in to comment.