Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

error C1016: #if[n]def expected an identifier & IntelliSense: expected an identifier

Status
Not open for further replies.

klun

Junior Member level 2
Joined
May 1, 2015
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
386
error C1016: #if[n]def expected an identifier & IntelliSense: expected an identifier


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef (__BIG_ENDIAN__) and !define (__LITTLE_ENDIAN__) *Error in this line*
#define __LITTLE_ENDIAN__
#endif
 
namespace {
 
union Converter32 {
  uint32_t bit_32;
  struct {
 
#ifdef __LITTLE_ENDIAN__
    uint8_t byte3;
    uint8_t byte2;
    uint8_t byte1;
    uint8_t byte0;
#else
    uint8_t byte0;
    uint8_t byte1;
    uint8_t byte2;
    uint8_t byte3;
#endif



Can someone help me on the errors?
 

horace1

Advanced Member level 5
Joined
Nov 18, 2008
Messages
2,123
Helped
596
Reputation
1,188
Reaction score
573
Trophy points
1,393
Location
Norwich, UK
Activity points
13,071
Re: error C1016: #if[n]def expected an identifier & IntelliSense: expected an identi

should it be
Code:
#ifndef __BIG_ENDIAN__
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__
#endif
#endif

...
 

xenos

Full Member level 4
Joined
May 9, 2015
Messages
212
Helped
82
Reputation
164
Reaction score
81
Trophy points
28
Location
127.0.0.1
Activity points
1,182
Re: error C1016: #if[n]def expected an identifier & IntelliSense: expected an identi


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef (__BIG_ENDIAN__) and !define (__LITTLE_ENDIAN__) *Error in this line*
#define __LITTLE_ENDIAN__
#endif
 
namespace {
 
union Converter32 {
  uint32_t bit_32;
  struct {
 
#ifdef __LITTLE_ENDIAN__
    uint8_t byte3;
    uint8_t byte2;
    uint8_t byte1;
    uint8_t byte0;
#else
    uint8_t byte0;
    uint8_t byte1;
    uint8_t byte2;
    uint8_t byte3;
#endif



Can someone help me on the errors?


Code C - [expand]
1
2
3
#if !defined(__BIG_ENDIAN__) && !defined (__LITTLE_ENDIAN__)
#define __LITTLE_ENDIAN__
#endif

 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top