Skip to content

Commit f853b99

Browse files
davywmpictor
authored andcommitted
Added exppp dll import/export scheme for MSVC.
* Added SCL_EXPPP_EXPORT flag for all global variables in headers. * Added SCL_EXPPP_EXPORT flag for all function prototypes in headers. * Added SCL_EXPRESS_DLL_IMPORTS flag for exppp CMakeLists.txt * Added SCL_EXPPP_DLL_EXPORTS flag for exppp CMakeLists.txt Signed-off-by: davyw <davy.wouters@gmail.com>
1 parent ba12196 commit f853b99

File tree

2 files changed

+54
-48
lines changed

2 files changed

+54
-48
lines changed

include/exppp/exppp.h

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
1-
extern int exppp_nesting_indent; /* default nesting indent */
2-
extern int exppp_continuation_indent; /* default nesting indent for */
1+
#include <scl_export.h>
2+
3+
extern SCL_EXPPP_EXPORT int exppp_nesting_indent; /* default nesting indent */
4+
extern SCL_EXPPP_EXPORT int exppp_continuation_indent; /* default nesting indent for */
35
/* continuation lines */
4-
extern int exppp_linelength; /* leave some slop for closing */
6+
extern SCL_EXPPP_EXPORT int exppp_linelength; /* leave some slop for closing */
57
/* parens. \n is not included in */
68
/* this count either */
7-
extern bool exppp_rmpp; /* if true, create rmpp */
8-
extern bool exppp_alphabetize; /* if true, alphabetize */
9-
extern bool exppp_terse; /* don't describe action to stdout */
10-
extern bool exppp_reference_info; /* if true, add commentary */
9+
extern SCL_EXPPP_EXPORT bool exppp_rmpp; /* if true, create rmpp */
10+
extern SCL_EXPPP_EXPORT bool exppp_alphabetize; /* if true, alphabetize */
11+
extern SCL_EXPPP_EXPORT bool exppp_terse; /* don't describe action to stdout */
12+
extern SCL_EXPPP_EXPORT bool exppp_reference_info; /* if true, add commentary */
1113
/* about where things came from */
12-
extern bool exppp_preserve_comments; /* if true, preserve comments where */
14+
extern SCL_EXPPP_EXPORT bool exppp_preserve_comments; /* if true, preserve comments where */
1315
/* possible */
14-
extern char * exppp_output_filename; /* force output filename */
15-
extern bool exppp_output_filename_reset; /* if true, force output filename */
16+
extern SCL_EXPPP_EXPORT char * exppp_output_filename; /* force output filename */
1617

17-
void EXPRESSout( Express e );
18+
SCL_EXPPP_EXPORT void EXPRESSout( Express e );
1819

19-
void ENTITYout( Entity e );
20-
void EXPRout( Expression expr );
21-
void FUNCout( Function f );
22-
void PROCout( Procedure p );
23-
void RULEout( Rule r );
24-
char * SCHEMAout( Schema s );
25-
void SCHEMAref_out( Schema s );
26-
void STMTout( Statement s );
27-
void TYPEout( Type t );
28-
void TYPEhead_out( Type t );
29-
void TYPEbody_out( Type t );
30-
void WHEREout( Linked_List w );
20+
SCL_EXPPP_EXPORT void ENTITYout( Entity e );
21+
SCL_EXPPP_EXPORT void EXPRout( Expression expr );
22+
SCL_EXPPP_EXPORT void FUNCout( Function f );
23+
SCL_EXPPP_EXPORT void PROCout( Procedure p );
24+
SCL_EXPPP_EXPORT void RULEout( Rule r );
25+
SCL_EXPPP_EXPORT char * SCHEMAout( Schema s );
26+
SCL_EXPPP_EXPORT void SCHEMAref_out( Schema s );
27+
SCL_EXPPP_EXPORT void STMTout( Statement s );
28+
SCL_EXPPP_EXPORT void TYPEout( Type t );
29+
SCL_EXPPP_EXPORT void TYPEhead_out( Type t );
30+
SCL_EXPPP_EXPORT void TYPEbody_out( Type t );
31+
SCL_EXPPP_EXPORT void WHEREout( Linked_List w );
3132

32-
char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
33-
char * ENTITYto_string( Entity e );
34-
char * SUBTYPEto_string( Expression e );
35-
char * EXPRto_string( Expression expr );
36-
char * FUNCto_string( Function f );
37-
char * PROCto_string( Procedure p );
38-
char * RULEto_string( Rule r );
39-
char * SCHEMAref_to_string( Schema s );
40-
char * STMTto_string( Statement s );
41-
char * TYPEto_string( Type t );
42-
char * TYPEhead_to_string( Type t );
43-
char * TYPEbody_to_string( Type t );
44-
char * WHEREto_string( Linked_List w );
33+
SCL_EXPPP_EXPORT char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
34+
SCL_EXPPP_EXPORT char * ENTITYto_string( Entity e );
35+
SCL_EXPPP_EXPORT char * SUBTYPEto_string( Expression e );
36+
SCL_EXPPP_EXPORT char * EXPRto_string( Expression expr );
37+
SCL_EXPPP_EXPORT char * FUNCto_string( Function f );
38+
SCL_EXPPP_EXPORT char * PROCto_string( Procedure p );
39+
SCL_EXPPP_EXPORT char * RULEto_string( Rule r );
40+
SCL_EXPPP_EXPORT char * SCHEMAref_to_string( Schema s );
41+
SCL_EXPPP_EXPORT char * STMTto_string( Statement s );
42+
SCL_EXPPP_EXPORT char * TYPEto_string( Type t );
43+
SCL_EXPPP_EXPORT char * TYPEhead_to_string( Type t );
44+
SCL_EXPPP_EXPORT char * TYPEbody_to_string( Type t );
45+
SCL_EXPPP_EXPORT char * WHEREto_string( Linked_List w );
4546

46-
int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
47-
int ENTITYto_buffer( Entity e, char * buffer, int length );
48-
int EXPRto_buffer( Expression e, char * buffer, int length );
49-
int FUNCto_buffer( Function e, char * buffer, int length );
50-
int PROCto_buffer( Procedure e, char * buffer, int length );
51-
int RULEto_buffer( Rule e, char * buffer, int length );
52-
int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
53-
int STMTto_buffer( Statement s, char * buffer, int length );
54-
int TYPEto_buffer( Type t, char * buffer, int length );
55-
int TYPEhead_to_buffer( Type t, char * buffer, int length );
56-
int TYPEbody_to_buffer( Type t, char * buffer, int length );
57-
int WHEREto_buffer( Linked_List w, char * buffer, int length );
47+
SCL_EXPPP_EXPORT int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
48+
SCL_EXPPP_EXPORT int ENTITYto_buffer( Entity e, char * buffer, int length );
49+
SCL_EXPPP_EXPORT int EXPRto_buffer( Expression e, char * buffer, int length );
50+
SCL_EXPPP_EXPORT int FUNCto_buffer( Function e, char * buffer, int length );
51+
SCL_EXPPP_EXPORT int PROCto_buffer( Procedure e, char * buffer, int length );
52+
SCL_EXPPP_EXPORT int RULEto_buffer( Rule e, char * buffer, int length );
53+
SCL_EXPPP_EXPORT int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
54+
SCL_EXPPP_EXPORT int STMTto_buffer( Statement s, char * buffer, int length );
55+
SCL_EXPPP_EXPORT int TYPEto_buffer( Type t, char * buffer, int length );
56+
SCL_EXPPP_EXPORT int TYPEhead_to_buffer( Type t, char * buffer, int length );
57+
SCL_EXPPP_EXPORT int TYPEbody_to_buffer( Type t, char * buffer, int length );
58+
SCL_EXPPP_EXPORT int WHEREto_buffer( Linked_List w, char * buffer, int length );

src/exppp/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ include_directories(
1212
${SCL_SOURCE_DIR}/include/exppp
1313
)
1414

15+
if(MSVC)
16+
add_definitions( -DSCL_EXPPP_DLL_EXPORTS )
17+
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
18+
endif(MSVC)
19+
1520
SCL_ADDLIB(libexppp "${LIBEXPPP_SOURCES}" express)
1621
set_target_properties(libexppp PROPERTIES PREFIX "")
1722

0 commit comments

Comments
 (0)