By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Using the Bluegiga library with C++Builder X5

P: 2
I'm running into a compiler error and it has to do with PACKSTRUCT macro. I don't know what I need to change for the BGLIB and BGAPI to work with C++Builder 5X. I have scoured the Bluegiga forums and knowledge base, as well as the internet. No luck. Any suggestions or other help much appreciated.
Dec 21 '15 #1
Share this Question
Share on Google+
2 Replies


zmbd
Expert Mod 5K+
P: 5,397
what is/are the specific error(s), number(s) and description(s)
Dec 22 '15 #2

P: 2
here's the message at the top of the cmd_def.h file that produces the errors:
Expand|Select|Wrap|Line Numbers
  1. /*****************************************************************************
  2.  *
  3.  *      Support for compilers other than GCC and MSVC:
  4.  *      
  5.  *      To support specific compiler add compiler's structure packing directives to following macro:
  6.  *          PACKSTRUCT( decl )
  7.  *          
  8.  *      BGLIB uses PACKSTRUCT macro to add packing information for structures:
  9.  *      PACKSTRUCT(struct wifi_msg_dfu_reset_cmd_t
  10.  *      {
  11.  *          uint8    dfu;
  12.  *      });
  13.  *
  14.  *
  15.  ****************************************************************************/
  16.  
  17. /*lint -save --e{528,572,778,845,835,849}*/
  18. #include "apitypes.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. /* Compability */
  24. #ifndef PACKSTRUCT
  25. #ifdef PACKED
  26. #define PACKSTRUCT(a) a PACKED 
  27. #else
  28. /*Default packed configuration*/
  29. #ifdef __GNUC__
  30. #ifdef _WIN32
  31. #define PACKSTRUCT( decl ) decl __attribute__((__packed__,gcc_struct))
  32. #else
  33. #define PACKSTRUCT( decl ) decl __attribute__((__packed__))
  34. #endif
  35. #define ALIGNED __attribute__((aligned(0x4)))
  36.  
  37. #else //msvc
  38.  
  39. #define PACKSTRUCT( decl ) __pragma( pack(push, 1) ) decl __pragma( pack(pop) )
  40. #define ALIGNED
  41.  
  42. #endif
  43. #endif
  44. #endif
and a typical error (there are lots like this)
[BCC32 Error] cmd_def.h(851): E2147 'pack' cannot start a parameter declaration
Full parser context
cmd_def.c(14): #include C:\Bluegiga\ble-1.3.2-122\src\bglib\cmd_def.h
Dec 22 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.