[mecab-users 433] バグ報告

Back to archive index

Keiichiro Oura urate****@sp*****
2011年 2月 7日 (月) 18:04:57 JST


大浦と申します.

src/mempoo.hにてMECAB_WITHOUT_SHARE_DICが定義されている時,
以下の#defineでコンパイルエラーが起こりました.
バグかもしれないので報告しておきます.

【修正前】
#define MMAP_OPEN(type,map,file) do { \
  map = new Mmap<type>; \
  if (! map->open (file.c_str())) { \
    WHAT(map->what()); close(); return false; \
  } \
} while (0)

#define MMAP_CLOSE(type,map) do { \
  delete map; } while (0)

【修正後】
#define MMAP_OPEN(type, map, file, mode) do {   \
    map = new Mmap<type>;                       \
    if (!map->open(file.c_str(), mode)) {       \
      close();                                  \
      return false;                             \
    }                                           \
  } while (0)

#define MMAP_CLOSE(type, map) do {              \
    if(map) delete map; map = NULL; } while (0)

よろしくお願いいたします.




mecab-users メーリングリストの案内
Back to archive index