Skip to content

Commit 457d51e

Browse files
davywmpictor
authored andcommitted
Added utils dll import/export scheme for MSVC.
* Added SCL_UTILS_EXPORT flag. * Added SCL_UTILS_DLL_EXPORTS flag for exppp CMakeLists.txt
1 parent 69acdf3 commit 457d51e

File tree

9 files changed

+40
-27
lines changed

9 files changed

+40
-27
lines changed

src/clutils/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ include_directories(
2929
${CMAKE_CURRENT_SOURCE_DIR}
3030
)
3131

32+
if (MSVC)
33+
add_definitions( -DSCL_UTILS_DLL_EXPORTS )
34+
endif(MSVC)
35+
3236
SCL_ADDLIB(steputils "${LIBSTEPUTILS_SRCS}" "")
3337

3438
IF(MINGW)

src/clutils/Str.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* and is not subject to copyright.
1414
*/
1515

16+
#include <scl_export.h>
1617
#include <ctype.h>
1718

1819
#include <stdio.h>
@@ -29,19 +30,19 @@
2930
#define StrCmpIns(a,b) strcasecmp(a,b)
3031
#endif
3132

32-
char ToLower (const char c);
33-
char ToUpper (const char c);
34-
char * StrToLower (const char *, char *);
35-
const char * StrToLower (const char * word, std::string &s);
36-
const char * StrToUpper (const char * word, std::string &s);
37-
const char * StrToConstant (const char * word, std::string &s);
38-
const char * PrettyTmpName (const char * oldname);
39-
char * PrettyNewName (const char * oldname);
40-
char * EntityClassName ( char * oldname);
33+
SCL_UTILS_EXPORT char ToLower (const char c);
34+
SCL_UTILS_EXPORT char ToUpper (const char c);
35+
SCL_UTILS_EXPORT char * StrToLower (const char *, char *);
36+
SCL_UTILS_EXPORT const char * StrToLower (const char * word, std::string &s);
37+
SCL_UTILS_EXPORT const char * StrToUpper (const char * word, std::string &s);
38+
SCL_UTILS_EXPORT const char * StrToConstant (const char * word, std::string &s);
39+
SCL_UTILS_EXPORT const char * PrettyTmpName (const char * oldname);
40+
SCL_UTILS_EXPORT char * PrettyNewName (const char * oldname);
41+
SCL_UTILS_EXPORT char * EntityClassName ( char * oldname);
4142

42-
std::string ToExpressStr (istream &in, ErrorDescriptor *err);
43+
SCL_UTILS_EXPORT std::string ToExpressStr (istream &in, ErrorDescriptor *err);
4344

44-
extern Severity CheckRemainingInput
45+
extern SCL_UTILS_EXPORT Severity CheckRemainingInput
4546
(istream &in, ErrorDescriptor *err,
4647
const char *typeName, // used in error message
4748
const char *tokenList); // e.g. ",)"

src/clutils/dirobj.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
///////////////////////////////////////////////////////////////////////////////
3535

3636
#include <scl_cf.h>
37+
#include <scl_export.h>
3738
#include <stdlib.h>
3839

3940
#include <string.h>
@@ -46,7 +47,7 @@
4647

4748
/*****************************************************************************/
4849

49-
class DirObj {
50+
class SCL_UTILS_EXPORT DirObj {
5051
public:
5152
DirObj(const char* dirName);
5253
virtual ~DirObj();

src/clutils/errordesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* and is not subject to copyright.
1414
*/
1515

16-
16+
#include <scl_export.h>
1717
#include <string>
1818
#include <iostream>
1919
using namespace std;
@@ -56,7 +56,7 @@ enum DebugLevel {
5656
** Status:
5757
******************************************************************/
5858

59-
class ErrorDescriptor {
59+
class SCL_UTILS_EXPORT ErrorDescriptor {
6060
protected:
6161
Severity _severity;
6262

src/clutils/gennode.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/* $Id: gennode.h,v 3.0.1.3 1997/11/05 22:33:47 sauderd DP3.1 $ */
1717

18+
#include <scl_export.h>
1819
#ifdef __O3DB__
1920
#include <OpenOODB.h>
2021
#endif
@@ -29,7 +30,7 @@ class DisplayNodeList;
2930
// If you delete this object it first removes itself from any list it is in.
3031
//////////////////////////////////////////////////////////////////////////////
3132

32-
class GenericNode
33+
class SCL_UTILS_EXPORT GenericNode
3334
{
3435
friend class GenNodeList;
3536
friend class MgrNodeList;

src/clutils/gennodearray.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Copyright (c) 1990 Stanford University
2222
*/
2323

24+
#include <scl_export.h>
2425
#ifdef __O3DB__
2526
#include <OpenOODB.h>
2627
#endif
@@ -41,7 +42,7 @@
4142
// DeleteEntries().
4243
//////////////////////////////////////////////////////////////////////////////
4344

44-
class GenNodeArray
45+
class SCL_UTILS_EXPORT GenNodeArray
4546
{
4647
public:
4748

src/clutils/gennodelist.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/* $Id: gennodelist.h,v 3.0.1.2 1997/11/05 22:33:48 sauderd DP3.1 $ */
1717

18+
#include <scl_export.h>
1819
#ifdef __O3DB__
1920
#include <OpenOODB.h>
2021
#endif
@@ -29,7 +30,7 @@
2930
// as its head, you need to call DeleteEntries().
3031
//////////////////////////////////////////////////////////////////////////////
3132

32-
class GenNodeList {
33+
class SCL_UTILS_EXPORT GenNodeList {
3334
public:
3435
GenNodeList(GenericNode *headNode);
3536
virtual ~GenNodeList() { delete head; }

src/clutils/scl_char_str_list.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef SCL_CHAR_STR_LIST_H
22
#define SCL_CHAR_STR_LIST_H
33

4+
#include <scl_export.h>
5+
46
typedef char * scl_char_str_ptr;
57

6-
class scl_char_str__list {
8+
class SCL_UTILS_EXPORT scl_char_str__list {
79
public:
810
scl_char_str__list(int = 16);
911
~scl_char_str__list();

src/clutils/scl_hash.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
*
9292
*/
9393

94+
#include <scl_export.h>
95+
9496
typedef enum { HASH_FIND, HASH_INSERT, HASH_DELETE } Action;
9597

9698
struct Element {
@@ -130,15 +132,15 @@ typedef struct {
130132
extern "C" {
131133
#endif
132134

133-
struct Hash_Table *HASHcreate(unsigned);
134-
void HASHinitialize(void);
135-
void *HASHfind(struct Hash_Table *, char *);
136-
void HASHinsert(struct Hash_Table *, char *,void *);
137-
void HASHdestroy(struct Hash_Table *);
138-
struct Element *HASHsearch(struct Hash_Table *,const struct Element *, Action);
139-
void HASHlistinit(struct Hash_Table *,HashEntry *);
140-
void HASHlistinit_by_type(struct Hash_Table *,HashEntry *,char);
141-
struct Element *HASHlist(HashEntry *);
135+
SCL_UTILS_EXPORT struct Hash_Table *HASHcreate(unsigned);
136+
SCL_UTILS_EXPORT void HASHinitialize(void);
137+
SCL_UTILS_EXPORT void *HASHfind(struct Hash_Table *, char *);
138+
SCL_UTILS_EXPORT void HASHinsert(struct Hash_Table *, char *,void *);
139+
SCL_UTILS_EXPORT void HASHdestroy(struct Hash_Table *);
140+
SCL_UTILS_EXPORT struct Element *HASHsearch(struct Hash_Table *,const struct Element *, Action);
141+
SCL_UTILS_EXPORT void HASHlistinit(struct Hash_Table *,HashEntry *);
142+
SCL_UTILS_EXPORT void HASHlistinit_by_type(struct Hash_Table *,HashEntry *,char);
143+
SCL_UTILS_EXPORT struct Element *HASHlist(HashEntry *);
142144

143145
#ifdef __cplusplus
144146
}

0 commit comments

Comments
 (0)