great that worked ! many thanks
Type: Posts; User: adetheheat
great that worked ! many thanks
Thanks for your help:
#define PACK_ON(n) _Pragma("pack(" #n ")")
gave error: _Pragma takes a parenthesized string literal
and
#define PACK_ON(n) _Pragma("pack(" ## #n ## ")")
I want to put #pragma pack(n) as a preprocessor define.
eg
#define PACK_ON(n) _Pragma("pack(n)")
PACK_ON(2)
I get the compile warning:
warning: unknown action 'n' for...
bracket in the wrong place.
many thanks
I have the following #defines
Code:
#define BLDR_FRAME_SIZE (((4u + (PR_BOOTLOADER_NUM_TRANSACTIONS_PER_FRAME * 3u * 6u) + \
...
Turns out I needed the following around my extern "C":
#ifdef __cplusplus
extern "C" void call_GatewayList_Send(struct lgw_pkt_rx_s pkt_data);
#endif
then define the function in the cpp file...
Thanks for that, what you have said is pretty much what I have done now. Worth pointing out I'm building in the Eclipse IDE environment with a Cygwin compiler. The code is pretty much 50% C and 50%...
yes the prototype is definitely in the C file as I said above, but in any case here is the direct cut from the file:
void call_GatewayList_Send(struct lgw_pkt_rx_s pkt_data);
void...
I have my GatewayLT.hpp list class:
class GatewayList
{
private:
typedef std::list<Gateway*> GatewayStoreType;
GatewayStoreType store;
public:
ok using gdb for debugging it gets stuck on pthread_mutex_lock. After some playing about I discovered there is only 1 thread that has tried to lock it and that is the main calling thread. So I'm...
They were the first things I tried. i did a grep for 'main' and there is only one and that is in MainNS.cpp as expected. Also there are no macros doing anything with 'main'.
My project builds and runs on windows. Using makefile on linux then it builds but when I run it nothing at all comes out. The project has about 30 files in it. So I cut down the main function in file...
this doesn't work:
int main(int argc, char* argv[])
{
int n;
string stringvalues;
//int val[6];
unsigned char val[6];
this worked but i wanted hexvalue to be unsigned char, this didn't work - none of the values written to it were correct
So I'd do something like:
istringstream iss (mystring,istringstream::in);
int hexval[6];
int temp;
Suppose I have a string with hex numbers in it like this "1a:2b:3c:4d:5e:6f"
How do I use istringstream to parse it to get each of 1a, 2b, 3d, 4d, 5e, 6f hex numbers ?
cheers