Original Post
I'm getting compiler errors when compiling the NDS homebrew SDK for Wmb Asm.(With devkitARM. I'm posting here because I got zero help with these errors on a DS homebrew forum) Errors: Link to dirscan.c in SVN. wmb_asm_sdk.h: wmb_asm_sdk_internal.h pcap.h
> "make"
dirscan.c
arm-eabi-gcc -MMD -MP -MF /c/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/build/dirscan.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/include -I/c/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK//c/devkitPro\libnds\include -I/c/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/build -DARM9 -c /c/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/dirscan.c -o dirscan.o
In file included from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/dirscan.c:24:
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:60: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PCAP_CheckAVS'
In file included from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:125,
from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/dirscan.c:24:
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\/../include/pcap.h:55: error: expected specifier-qualifier-list before 'bool'
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\/../include/pcap.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GetPacketHasAVS'
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\/../include/pcap.h:80: error: expected ')' before 'val'
In file included from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/dirscan.c:24:
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:235: error: expected specifier-qualifier-list before 'bool'
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:519: error: expected ':', ',', ';', '}' or '__attribute__' before 'data_init'
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:596: error: expected specifier-qualifier-list before 'bool'
In file included from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\wmb_asm_sdk.h:736,
from c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/dirscan.c:24:
c:/YellowstarConsoleStuff/wmb_asm/SVN/trunk/wmb_asm/SDK/source/..\include\/wmb_asm_sdk_internal.h:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
make[1]: *** [dirscan.o] Error 1
"make": *** [build] Error 2
/*
Wmb Asm, the SDK, and all software in the Wmb Asm package are licensed under the MIT license:
Copyright (c) 2008 yellowstar
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the “Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef _H_WMB_ASM_SDK
#define _H_WMB_ASM_SDK
#define ASM_SDK_VERSION_MAJOR 1
#define ASM_SDK_VERSION_MINOR 0
#define ASM_SDK_VERSION_RELEASE 0
#define ASM_SDK_VERSION_BUILD 0
#define ASM_SDK_VERSION_STR "1.0b"
#define ASM_MODULE_VERSION_MAJOR 2//These defines are the Wmb Asm Module version this version of the SDK was built with.
#define ASM_MODULE_VERSION_MINOR 0
#define ASM_MODULE_VERSION_RELEASE 1
#define ASM_MODULE_VERSION_BUILD 0
#define ASM_MODULE_VERSION_STR "2.0b r2"
#ifndef __cplusplus
enum bool {false = 0, true = 1};
#endif
#ifdef BUILDING_SDK
#ifndef BUILDING_DLL
#undef DLLIMPORT
#define DLLIMPORT
#undef USING_DLL
#endif
#ifdef BUILDING_DLL
#undef DLLIMPORT
#define DLLIMPORT __declspec (dllexport)
#endif
#ifdef BUILDING_DLL
#ifndef USING_DLL
#define USING_DLL
#endif
#endif
extern bool PCAP_CheckAVS;//wmb_asm_sdk.h compiler errors here
#endif
//This file is included by wmb_asm_sdk.h, but only if we are building the SDK.
#ifdef BUILDING_SDK
#ifndef WMB_ASM_SDK_INTERNAL
#define WMB_ASM_SDK_INTERNAL
#ifdef SDK_MAIN
volatile struct Nds_data **sdk_nds_data = NULL;
bool *SDK_DEBUG = NULL;
FILE **SDK_Log = NULL;
struct sAsmSDK_Config *SDK_CONFIG = NULL;
#endif
#ifndef SDK_MAIN
extern volatile struct Nds_data **sdk_nds_data;
extern bool *SDK_DEBUG;//wmb_asm_sdk_internal.h compiler errors here
extern FILE **SDK_Log;
extern struct sAsmSDK_Config *SDK_CONFIG;
#endif
#endif
#endif
/*
Wmb Asm, the SDK, and all software in the Wmb Asm package are licensed under the MIT license:
Copyright (c) 2008 yellowstar
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the “Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
//Custom pcap implemention with the same interface as libpcap, to easily switch between using my implemention, and libpcap, and so captures with truncated packets can be used. These packets are skipped, it doesn't stop reading the capture all together. Before this was implemented, it was impossible to assemble captures with truncated packets, with libpcap.
#ifndef lib_pcap_h
#ifndef _H_CUSTOM_PCAP
#define _H_CUSTOM_PCAP
#define PCAP_VERSION_MAJOR 2
#define PCAP_VERSION_MINOR 4
#define PCAP_ERRBUF_SIZE 256
typedef unsigned char u_char;
typedef unsigned int u_int;
typedef struct spcap_file_header {
unsigned int magic;
unsigned short majorVersion;
unsigned short minorVersion;
unsigned int timeZoneOffset;
unsigned int timeStampAccuracy;
unsigned int snapshotLength;
unsigned int linkLayerType;
} __attribute__ ((__packed__)) pcap_file_header;
typedef struct spcap_pkthdr {
long tv_sec;
long tv_usec; /* time stamp */
unsigned int caplen; /* length of portion present */
unsigned int len; /* length this packet (off wire) */
} __attribute__ ((__packed__)) pcap_pkthdr;
struct pcap_t
{
FILE *file;
bool swap;//Error here
pcap_pkthdr header;
unsigned char *pktdata;
char *error_buffer;
} __attribute__ ((__packed__));
#ifdef __cplusplus
extern "C" {
#endif
struct pcap_t *pcap_open_offline(const char *filename, char *errbuf);
int pcap_next_ex(struct pcap_t *file, pcap_pkthdr **hdr, const u_char **pktdata);
void pcap_close(struct pcap_t *file);
char *pcap_geterr(struct pcap_t *file);
#ifdef ASM_SDK_CLIENT
int GetPacketNumber();//Yeah, this may seem strange having double prototypes here, but it's nesscary due to compiler errors that result when removing the double and the preprocesser directives.
#endif
#ifdef BUILDING_SDK
int GetPacketNumber();
#endif
int GetSnapshotLength();
bool GetPacketHasAVS();//Error here
void SetPacketHasAVS(bool val);//Error here
#ifdef __cplusplus
}
#endif
#endif
#endif