Skip to content

Commit 879f509

Browse files
davywmpictor
authored andcommitted
Made changes to prevent compiler/linker errors of express.
* Renamed __in to __i in LISTdo_links macro because __in is a reserved macro for MSVC. * Renamed isascii to __isascii for MSVC. * Added __MSVC__ to compiler flags and use it.
1 parent 6226717 commit 879f509

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_stri
239239

240240
if(MSVC)
241241
# add_definitions( -Wall )
242-
add_definitions( -D__STDC__ -D__WIN32__ )
242+
add_definitions( -D__MSVC__ -D__STDC__ -D__WIN32__ )
243243
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
244244
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
245245
else()

include/express/basic.h

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

113113
#if !defined(static_inline)
114-
#if !defined(__GNUC__) || defined(__STRICT_ANSI)
114+
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
115115
#define static_inline
116116
#undef supports_inline_functions
117117
#else

include/express/lexact.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ SCANnextchar( char * buffer ) {
162162
SCANbuffer.numRead--;
163163
#endif
164164
buffer[0] = *( SCANcurrent++ );
165-
if( !isascii( buffer[0] ) ) {
165+
#ifdef __MSVC__
166+
if( !__isascii( buffer[0] ) ) {
167+
#else
168+
if( !isascii( buffer[0] ) ) {
169+
#endif
166170
ERRORreport_with_line( ERROR_nonascii_char, yylineno,
167171
0xff & buffer[0] );
168172
buffer[0] = ' '; /* substitute space */

include/express/linklist.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
117117
(elt) = (type)((__p)->data);
118118

119119
#define LISTdo_links(list, link) \
120-
{Linked_List __in = (list); \
121-
Link link; \
122-
if (__in != LIST_NULL) { \
123-
for ((link) = __in->mark; ((link) = (link)->next) != __in->mark; ) {
120+
{Linked_List __i = (list); \
121+
Link link; \
122+
if (__i != LIST_NULL) { \
123+
for ((link) = __i->mark; ((link) = (link)->next) != __i->mark; ) {
124124
#define LISTod }}}
125125

126126
/* accessing */

0 commit comments

Comments
 (0)