#118 Don't touch preprocessor indent

closed-fixed
2015-01-03
2011-10-26
No

Sometimes we like to have indentation of preprocessor statements, but Astyle forces all preprocessor statements to be left aligned (no indentation). Is it possible to have an option, so the preprocessor indentation checks are ignored.

Thanks.

Example :
We like to have

#ifdef xxx
^^#define yyy zzz
#else
^^#define yyy www
#endif

But astyle changes it to

#ifdef xxx
#define yyy zzz
#else
#define yyy www
#endif

Discussion

  • Jim Pattee

    Jim Pattee - 2013-10-09

    Option in SVN.

     
  • Jim Pattee

    Jim Pattee - 2013-10-09
    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Group: --> 1.15.3
    • Priority: 5 --> 7
     
  • Jim Pattee

    Jim Pattee - 2013-11-05
    • status: open-fixed --> closed-fixed
     
  • Alex pap

    Alex pap - 2014-05-05

    This issue hasn't been fixed. What was added was the ability to indent "preprocessor statements to the same level as the source code".
    What we want is to indent code inside preprocessor conditional statements, e.g.

    #if defined(HAVE_REALPATH)
        #include <limits.h>
    #endif
    

    and

    #if DEBUG
        fprintf(stderr,"testing");
    #endif
    
     
    Last edit: Alex pap 2014-05-05

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks