#237 #ifdef __cplusplus causes unindentation of first function following it.

2.x
closed-fixed
Jim Pattee
None
7
2014-03-13
2013-10-03
Rene Nielsen
No

I downloaded and compiled this version of astyle (Linux, gcc):
  Last Changed Rev: 396
  Last Changed Date: 2013-09-23 21:33:26 +0200 (Mon, 23 Sep 2013)

Running astyle on the following code:
#if defined(__cplusplus)
extern "C" void A(void);
#else
void A(void);
#endif // __cplusplus
void B(void)
{
    A();
}

void C(void)
{
    A();
}

Produced the following:
#if defined(__cplusplus)
extern "C" void A(void);
#else
void A(void);
#endif // __cplusplus

void B(void)
{
A();
}

void C(void)
{
    A();
}

That is, (only) the first function after #if defined(__cplusplus)...#endif got unindented.
If I change __cplusplus to something else, it works as expected.

Thanks,
René Nielsen

Discussion

  • Jim Pattee
    Jim Pattee
    2013-10-12

    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee
    Jim Pattee
    2013-10-12

    Fixed in SVN.

     
  • Jim Pattee
    Jim Pattee
    2013-11-05

    • status: open-fixed --> closed-fixed