Changeset 63d246bfa1ad0af79d78e35671481fbfa7ad3129

Show
Ignore:
Timestamp:
04/26/08 08:30:15 (9 months ago)
Author:
krayouva <krayouva@…>
Parents:
4640c75a8385ecb909a2b09d28eca23a6c4f6130
Children:
d6dd39b080e1233923cadd56d686820dbbb8ca5d
git-committer:
krayouva <krayouva@gmail.com> / 2008-04-25T18:30:15Z-0400
Message:

* Added extern "C" guards around all C headers when using a c++ compiler

- Needed to do this so that the benchmark task builds with g++

Location:
c
Files:
23 modified

Legend:

Unmodified
Added
Removed
  • c/benchmark/all_benchmarks.h

    r76c5d7 r63d246  
    22#define ALL_BENCHMARKS_H 
    33 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
     7 
    48#include "benchmark.h" 
    5  
    69 
    710void bm_vint_io(BenchMark *bm); 
     
    2528}; 
    2629 
     30#ifdef __cplusplus 
     31} // extern "C" 
    2732#endif 
     33 
     34#endif 
  • c/benchmark/benchmark.h

    r4640c7 r63d246  
    11#ifndef BENCHMARK_H 
    22#define BENCHMARK_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    913 
    1014#define BM_RUN_COUNT 6 
    11 #ifdef __cplusplus 
    12 #define BENCH(name) extern "C" void bm_##name(BenchMark *bm) 
    13 #else 
    14 #define BENCH(name) void bm_##name(BenchMark *bm) 
    15 #endif 
     15#define BENCH(name) FRT_EXTERNC void bm_##name(BenchMark *bm) 
    1616 
    1717extern const char *WORD_LIST[]; 
     
    5050#define BM_DISCARD(num) bm->discard = num; 
    5151 
     52#ifdef __cplusplus 
     53} // extern "C" 
    5254#endif 
     55 
     56#endif 
  • c/include/analysis.h

    r442a23 r63d246  
    11#ifndef FRT_ANALYSIS_H 
    22#define FRT_ANALYSIS_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    228232extern void frt_pfa_add_field(FrtAnalyzer *self, char *field, FrtAnalyzer *analyzer); 
    229233 
     234#ifdef __cplusplus 
     235} // extern "C" 
    230236#endif 
     237 
     238#endif 
  • c/include/array.h

    r2eff78 r63d246  
    11#ifndef FRT_ARRAY_H 
    22#define FRT_ARRAY_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
     7 
    38#include "global.h" 
    49 
     
    5156extern void   frt_ary_destroy_i(void **ary, frt_free_ft p); 
    5257 
     58#ifdef __cplusplus 
     59} // extern "C" 
    5360#endif 
     61 
     62#endif 
  • c/include/config.h

    r5a8e6f r63d246  
    11#ifndef FRT_DEFINES_H 
    22#define FRT_DEFINES_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include <sys/types.h> 
     
    4246#endif 
    4347 
     48#ifdef __cplusplus 
     49} // extern "C" 
    4450#endif 
     51 
     52#endif 
  • c/include/document.h

    r48290f r63d246  
    11#ifndef FRT_DOCUMENT_H 
    22#define FRT_DOCUMENT_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    5256extern void frt_doc_destroy(FrtDocument *doc); 
    5357 
     58#ifdef __cplusplus 
     59} // extern "C" 
    5460#endif 
     61 
     62#endif 
  • c/include/except.h

    ra3ed62 r63d246  
    7070#ifndef FRT_EXCEPT_H 
    7171#define FRT_EXCEPT_H 
     72 
     73#ifdef __cplusplus 
     74extern "C" { 
     75#endif 
    7276 
    7377#include <setjmp.h> 
     
    166170extern char frt_xmsg_buffer_final[FRT_XMSG_BUFFER_SIZE]; 
    167171 
     172#ifdef __cplusplus 
     173} // extern "C" 
    168174#endif 
     175 
     176#endif 
  • c/include/field_index.h

    r86714d r63d246  
    11#ifndef FRT_FIELD_INDEX_H 
    22#define FRT_FIELD_INDEX_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "index.h" 
     
    4145extern float frt_get_float_value(FrtFieldIndex *field_index, long doc_num); 
    4246extern long frt_get_integer_value(FrtFieldIndex *field_index, long doc_num); 
     47 
     48#ifdef __cplusplus 
     49} // extern "C" 
    4350#endif 
     51 
     52#endif 
  • c/include/hash.h

    r48290f r63d246  
    11#ifndef FRT_HASH_H 
    22#define FRT_HASH_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    126130 */ 
    127131extern FrtHash *frt_h_new(frt_hash_ft hash, 
    128                                   frt_eq_ft eq,  
     132                                  frt_eq_ft eq, 
    129133                                  frt_free_ft free_key, 
    130134                                  frt_free_ft free_value); 
     
    480484extern void frt_h_str_print_keys(FrtHash *ht); 
    481485 
     486#ifdef __cplusplus 
     487} // extern "C" 
    482488#endif 
     489 
     490#endif 
  • c/include/hashset.h

    r48290f r63d246  
    11#ifndef FRT_HASHSET_H 
    22#define FRT_HASHSET_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "hash.h" 
     
    192196*/ 
    193197 
     198#ifdef __cplusplus 
     199} // extern "C" 
    194200#endif 
     201 
     202#endif 
  • c/include/helper.h

    r5a8e6f r63d246  
    11#ifndef FRT_HELPER_H 
    22#define FRT_HELPER_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "config.h" 
     
    1115extern unsigned char frt_float2byte(float f); 
    1216 
     17#ifdef __cplusplus 
     18} // extern "C" 
    1319#endif 
     20 
     21#endif 
  • c/include/ind.h

    r6a5a9e r63d246  
    11#ifndef FRT_IND_H 
    22#define FRT_IND_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "search.h" 
     
    6569extern FRT_INLINE void frt_ensure_writer_open(FrtIndex *self); 
    6670 
     71#ifdef __cplusplus 
     72} // extern "C" 
    6773#endif 
     74 
     75#endif 
  • c/include/index.h

    r48290f r63d246  
    11#ifndef FRT_INDEX_H 
    22#define FRT_INDEX_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    941945extern void frt_iw_delete_term(FrtIndexWriter *iw, const char *field, 
    942946                           const char *term); 
    943 extern void frt_iw_delete_terms(FrtIndexWriter *iw, const char *field,  
     947extern void frt_iw_delete_terms(FrtIndexWriter *iw, const char *field, 
    944948                            char **terms, const int term_cnt); 
    945949extern void frt_iw_close(FrtIndexWriter *iw); 
     
    976980extern void frt_cw_close(FrtCompoundWriter *cw); 
    977981 
    978  
     982#ifdef __cplusplus 
     983} // extern "C" 
    979984#endif 
     985 
     986#endif 
  • c/include/internal.h

    r442a23 r63d246  
    11#ifndef FRT_INTERNAL_H 
    22#define FRT_INTERNAL_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48/* Constants */ 
     
    974978#define xraise                                  frt_xraise 
    975979 
     980#ifdef __cplusplus 
     981} // extern "C" 
    976982#endif 
     983 
     984#endif 
  • c/include/lang.h

    r603e2a r63d246  
    11#ifndef FRT_LANG_H 
    22#define FRT_LANG_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include <stdarg.h> 
     
    4044extern void FRT_VEXIT(const char *err_type, const char *fmt, va_list args); 
    4145#endif 
     46 
     47#ifdef __cplusplus 
     48} // extern "C" 
    4249#endif 
     50 
     51#endif 
  • c/include/mempool.h

    r682015 r63d246  
    11#ifndef FRT_MEM_POOL_H 
    22#define FRT_MEM_POOL_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#define FRT_MP_BUF_SIZE 65536 
     
    3337    (type*)FRT_ZEROSET_N(frt_mp_alloc(mp, sizeof(type)*(n)), type, n) 
    3438 
     39#ifdef __cplusplus 
     40} // extern "C" 
    3541#endif 
     42 
     43#endif 
  • c/include/multimapper.h

    r48290f r63d246  
    11#ifndef FRT_MAPPER_H 
    22#define FRT_MAPPER_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "hash.h" 
     
    5054extern void frt_mulmap_destroy(FrtMultiMapper *self); 
    5155 
     56#ifdef __cplusplus 
     57} // extern "C" 
    5258#endif 
     59 
     60#endif 
  • c/include/priorityqueue.h

    rf7adc4 r63d246  
    11#ifndef FRT_PRIORITYQUEUE_H 
    22#define FRT_PRIORITYQUEUE_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include "global.h" 
     
    145149#define frt_pq_full(pq) ((pq)->size == (pq)->capa) 
    146150 
     151#ifdef __cplusplus 
     152} // extern "C" 
    147153#endif 
     154 
     155#endif 
  • c/include/scanner.h

    rf75f58 r63d246  
    11#ifndef FRT_SCANNER_H 
    22#define FRT_SCANNER_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48/* 
     
    2125                     int *token_length); 
    2226 
     27#ifdef __cplusplus 
     28} // extern "C" 
     29#endif 
     30 
    2331#endif /* FRT_SCANNER */ 
  • c/include/search.h

    r48290f r63d246  
    11#ifndef FRT_SEARCH_H 
    22#define FRT_SEARCH_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48typedef struct FrtQuery FrtQuery; 
     
    2428    struct FrtExplanation **details; 
    2529} FrtExplanation; 
    26   
     30 
    2731extern FrtExplanation *frt_expl_new(float value, const char *description, ...); 
    2832extern void frt_expl_destroy(FrtExplanation *expl); 
     
    259263/* *** FrtBooleanClause *** */ 
    260264 
    261 typedef enum  
     265typedef enum 
    262266{ 
    263267    FRT_BC_SHOULD, 
     
    695699extern char *frt_sort_field_to_s(FrtSortField *self); 
    696700 
    697 extern const FrtSortField FRT_SORT_FIELD_SCORE;  
    698 extern const FrtSortField FRT_SORT_FIELD_SCORE_REV;  
    699 extern const FrtSortField FRT_SORT_FIELD_DOC;  
    700 extern const FrtSortField FRT_SORT_FIELD_DOC_REV;  
     701extern const FrtSortField FRT_SORT_FIELD_SCORE; 
     702extern const FrtSortField FRT_SORT_FIELD_SCORE_REV; 
     703extern const FrtSortField FRT_SORT_FIELD_DOC; 
     704extern const FrtSortField FRT_SORT_FIELD_DOC_REV; 
    701705 
    702706/*************************************************************************** 
     
    760764{ 
    761765    float (*filter_func)(int doc_num, float score, FrtSearcher *self, void *arg); 
    762     void *arg;   
     766    void *arg; 
    763767} FrtPostFilter; 
    764768 
     
    792796     * Scan the index for all documents that match a query and write the 
    793797     * results to a buffer. It will stop scanning once the limit is reached 
    794      * and it starts scanning from offset_docnum.  
     798     * and it starts scanning from offset_docnum. 
    795799     * 
    796800     * Note: Unlike the offset_docnum in other search methods, this 
     
    935939extern int frt_qp_default_fuzzy_pre_len; 
    936940 
    937  
     941#ifdef __cplusplus 
     942} // extern "C" 
    938943#endif 
     944 
     945#endif 
  • c/include/similarity.h

    r5167b9 r63d246  
    11#ifndef FRT_SIMILARITY_H 
    22#define FRT_SIMILARITY_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48typedef struct FrtSearcher FrtSearcher; 
     
    8084FrtSimilarity *frt_sim_create_default(); 
    8185 
     86#ifdef __cplusplus 
     87} // extern "C" 
    8288#endif 
     89 
     90#endif 
  • c/include/threading.h

    r86714d r63d246  
    11#ifndef FRT_THREADING_H 
    22#define FRT_THREADING_H 
     3 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
    37 
    48#include <pthread.h> 
     
    2226#define frt_thread_once(a, b) pthread_once(a, b) 
    2327 
     28#ifdef __cplusplus 
     29} // extern "C" 
    2430#endif 
     31 
     32#endif 
  • c/include/win32.h

    r603e2a r63d246  
    1 #include "global.h" 
    2  
    31#ifndef FRT_WIN32_H 
    42#define FRT_WIN32_H 
    53 
     4#ifdef __cplusplus 
     5extern "C" { 
     6#endif 
     7 
     8#include "global.h" 
    69#include <io.h> 
    710 
     
    5255    free(d); 
    5356} 
     57 
     58#ifdef __cplusplus 
     59} // extern "C" 
    5460#endif 
     61 
     62#endif