The C test tool doesn't compile as a plain C program!

develop
Petr Mrázek 2011-04-10 15:36:01 +02:00
parent 1d35044db3
commit 7876a42258
4 changed files with 10 additions and 21 deletions

@ -28,15 +28,16 @@ distribution.
#include "dfhack/DFPragma.h" #include "dfhack/DFPragma.h"
namespace DFHack {};
using namespace DFHack;
#include "dfhack/DFExport.h" #include "dfhack/DFExport.h"
#include "dfhack/DFIntegers.h" #include "dfhack/DFIntegers.h"
typedef void DFHackObject; typedef void DFHackObject;
#ifdef __cplusplus #ifdef __cplusplus
namespace DFHack {};
using namespace DFHack;
extern "C" { extern "C" {
#endif #endif
// some global stuff here // some global stuff here

@ -256,12 +256,7 @@ DFHACK_EXPORT extern int (*alloc_featuremap_buffer_callback)(c_featuremap_node**
DFHACK_EXPORT void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t)); DFHACK_EXPORT void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t));
#ifdef __cplusplus #ifdef __cplusplus
} } // extern "C"
#endif #endif
/*
void BuildDescriptorList(std::vector<t_creaturetype> & src, c_creaturetype_descriptor** dest);
void FreeDescriptorList(c_creaturetype_descriptor* d, uint32_t length);
int CreatureTypeConvert(std::vector<t_creaturetype> &, c_creaturetype**);
*/
#endif #endif

@ -82,6 +82,6 @@ DFHACK_TOOL(dfhellhole hellhole.cpp)
# this needs the C bindings # this needs the C bindings
IF(BUILD_DFHACK_C_BINDINGS) IF(BUILD_DFHACK_C_BINDINGS)
# for trying out some 'stuff' # The C bindings won't be real C bindings until this compiles.
DFHACK_TOOL(dftest test.cpp) #DFHACK_TOOL(dftest test.c)
ENDIF(BUILD_DFHACK_C_BINDINGS) ENDIF(BUILD_DFHACK_C_BINDINGS)

@ -1,18 +1,11 @@
#include <iostream> #include <limits.h>
#include <iomanip> #include <time.h>
#include <climits> #include <stdio.h>
#include <vector>
#include <sstream>
#include <ctime>
#include <cstdio>
using namespace std;
#include <DFHack.h>
#include <DFHack_C.h> #include <DFHack_C.h>
#include <dfhack-c/DFTypes_C.h> #include <dfhack-c/DFTypes_C.h>
#include <dfhack-c/DFContext_C.h> #include <dfhack-c/DFContext_C.h>
#include <dfhack-c/modules/Maps_C.h> #include <dfhack-c/modules/Maps_C.h>
using namespace DFHack;
int main (int numargs, const char ** args) int main (int numargs, const char ** args)
{ {