Skip to content

Commit c0c423c

Browse files
committed
Added support for cmake 'Borland Makefiles' generator.
* Added __BORLAND__ flag to a number of places in the code. * Added BORLAND specific stuff to CMakeLists.txt files.
1 parent 555a574 commit c0c423c

File tree

8 files changed

+40
-4
lines changed

8 files changed

+40
-4
lines changed

include/express/basic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ typedef int ( *intFuncptr )();
112112
/******************************/
113113

114114
#if !defined(static_inline)
115-
#if (!defined(__GNUC__) && !defined(__MSVC__) && !defined(BORLAND)) || defined(__STRICT_ANSI)
115+
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
116116
#define static_inline
117117
#undef supports_inline_functions
118118
#else

include/express/linklist.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ extern SCL_EXPRESS_EXPORT int LISTget_length PROTO( ( Linked_List ) );
159159
/* inline function definitions */
160160
/*******************************/
161161

162+
#if !defined(__BORLAND__)
163+
162164
#if supports_inline_functions || defined(LINKED_LIST_C)
163165

164166
static_inline
@@ -175,4 +177,10 @@ LISTempty( Linked_List list ) {
175177

176178
#endif /* supports_inline_functions || defined(LINKED_LIST_C) */
177179

180+
#else
181+
182+
extern SCL_EXPRESS_EXPORT bool LISTempty( Linked_List list );
183+
184+
#endif
185+
178186
#endif /*LINKED_LIST_H*/

src/cleditor/STEPfile.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
22652265
return SEVERITY_INPUT_ERROR;
22662266
}
22672267

2268-
cout << "Reading Data from " << ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName() ) << "...\n";
2268+
cout << "Reading Data from " << ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName().c_str() ) << "...\n";
22692269

22702270
// Read header
22712271
rval = ReadHeader( *in );

src/clutils/Str.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424

2525
//StrCmpIns - case-insensitive string compare. Original fct (replaced Sep 2011)
2626
//called PrettyTmpName(). Not doing so may affect sort order but that shouldn't hurt
27-
#ifdef _MSC_VER
27+
#if defined(__MSVC__)
2828
#define StrCmpIns(a,b) _stricmp(a,b)
29+
#elif defined(__BORLAND__)
30+
#define StrCmpIns(a,b) stricmp(a,b)
2931
#else
3032
#define StrCmpIns(a,b) strcasecmp(a,b)
3133
#endif

src/exppp/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ add_definitions( -DSCL_EXPPP_DLL_EXPORTS )
1717
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
1818
endif()
1919

20+
if(BORLAND)
21+
add_definitions( -D__STDC__ )
22+
endif()
23+
2024
SCL_ADDLIB(libexppp "${LIBEXPPP_SOURCES}" express)
2125
set_target_properties(libexppp PROPERTIES PREFIX "")
2226

src/express/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ ELSE()
1515
set( YACC_FLAGS " " ) #FindYACC.cmake insists on 3, 5, or 7 args
1616
ENDIF()
1717

18+
IF(BORLAND)
19+
add_definitions( -DYYDEBUG=1 )#always define this. equivalent to 'bison -t'
20+
ELSE()
1821
add_definitions( -DYYDEBUG ) #always define this. equivalent to 'bison -t'
22+
ENDIF()
1923

2024
YACC_TARGET(ExpParser expparse.y ${CMAKE_CURRENT_BINARY_DIR}/expparse.c COMPILE_FLAGS ${YACC_FLAGS})
2125
LEX_TARGET(ExpScanner expscan.l ${CMAKE_CURRENT_BINARY_DIR}/expscan.c COMPILE_FLAGS ${LEX_FLAGS})
@@ -74,6 +78,10 @@ if(MSVC OR BORLAND)
7478
add_definitions( -DYY_NO_UNISTD_H )
7579
endif()
7680

81+
if(BORLAND)
82+
add_definitions( -D__STDC__ )
83+
endif()
84+
7785
SCL_ADDLIB(express "${EXPRESS_SOURCES}" "")
7886

7987
if(APPLE)

src/express/linklist.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,15 @@ LISTget_length( Linked_List list ) {
220220
}
221221
return count;
222222
}
223+
224+
#if defined(__BORLAND__)
225+
bool LISTempty( Linked_List list ) {
226+
if( !list ) {
227+
return true;
228+
}
229+
if( list->mark->next == list->mark ) {
230+
return true;
231+
}
232+
return false;
233+
}
234+
#endif

src/fedex_plus/classes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2974,8 +2974,10 @@ void TYPEprint_typedefs( Type t, FILE * classes ) {
29742974
}
29752975

29762976
/* Print the extern statement: */
2977+
#if !defined(__BORLAND__)
29772978
strncpy( nm, TYPEtd_name( t ), BUFSIZ );
2978-
fprintf( classes, "extern %s *%s;\n", GetTypeDescriptorName( t ), nm );
2979+
fprintf( classes, "extern %s *%s;\n", GetTypeDescriptorName( t ), nm );
2980+
#endif
29792981
}
29802982

29812983
/** return 1 if it is a multidimensional aggregate at the level passed in

0 commit comments

Comments
 (0)