Skip to content

Visual C++ source incompatibility #111

@marcstern

Description

@marcstern

In header.h, globals variables are called the following way:
extern const char *CJOSE_HDR_ALG;

In Visual C++, there's no way to have that declaration included in a third-party application, even by providing a DEF file. All exported variables have to be declared with
extern __declspec(dllimport).

Proposal, compatible with Visual C++ and others:

#ifdef _MSC_VER
# ifdef CJOSE_BUILD
#  define EXTERN extern __declspec(dllexport) 
# else
#  define EXTERN extern __declspec(dllimport) 
# endif
#else
# define EXTERN extern
#endif

EXTERN const char *CJOSE_HDR_ALG;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions