Navigation Menu

Skip to content

Commit

Permalink
win32: compile mrn_table with extern "C" linkage
Browse files Browse the repository at this point in the history
This change indended to link with variables declared at ha_mroonga.cpp.
ha_mroonga is compiled with extern "C" linkage, but mrn_table is not, so
Visual Studio can't resolve such external symbols.

Original error message is following:
  mrn_table.obj : error LNK2001: unresolved external symbol "char * mrn_default_parser" (?mrn_default_parser@@3PEADEA) [c:\work\mroonga\mroonga-vs2010-x64\ha_mroonga.vcxproj]
  ...
  • Loading branch information
kenhys committed Oct 5, 2012
1 parent a5110e4 commit 5d8f299
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mrn_table.cpp
Expand Up @@ -43,6 +43,10 @@
#define MRN_GROONGA_STR "GROONGA"
#define MRN_GROONGA_LEN (sizeof(MRN_GROONGA_STR) - 1)

#ifdef __cplusplus
extern "C" {
#endif

extern HASH mrn_open_tables;
extern pthread_mutex_t mrn_open_tables_mutex;
extern char *mrn_default_parser;
Expand Down Expand Up @@ -923,3 +927,7 @@ void mrn_clear_alter_share(THD *thd)
}
DBUG_VOID_RETURN;
}

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions mrn_table.hpp
Expand Up @@ -21,6 +21,10 @@
#ifndef _mrn_table_hpp
#define _mrn_table_hpp

#ifdef __cplusplus
extern "C" {
#endif

#include <groonga.h>

typedef struct st_mroonga_share
Expand Down Expand Up @@ -112,4 +116,8 @@ void mrn_set_bitmap_by_key(MY_BITMAP *map, KEY *key_info);
st_mrn_slot_data *mrn_get_slot_data(THD *thd, bool can_create);
void mrn_clear_alter_share(THD *thd);

#ifdef __cplusplus
}
#endif

#endif /* _mrn_table_hpp */

0 comments on commit 5d8f299

Please sign in to comment.