You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, there are many precompiled headers such as this:
// common.h
#pragma once
classCommon {
int field1;
char field2;
void *field3;
};
If common.h is precompiled, StructLayout's clang will fail to compile the header; clang ignores the #pragma once directive on the primary source file.
To side-step this issue, the plugin could take an alternative approach:
Generate a new sourcefile, structlayout.cpp:
#include"common.h"// this will respect #pragma once, if presentclassStructLayoutTarget {
Common real_target;
};
The plugin would then invoke clang with the appropriate headers, pch's, defines, etc as it does now, but targeting structlayout.cpp and its StructLayoutTarget class instead of targeting common.h and its Common class.
In my project, there are many precompiled headers such as this:
If common.h is precompiled, StructLayout's clang will fail to compile the header; clang ignores the
#pragma once
directive on the primary source file.To side-step this issue, the plugin could take an alternative approach:
Generate a new sourcefile,
structlayout.cpp
:The plugin would then invoke clang with the appropriate headers, pch's, defines, etc as it does now, but targeting
structlayout.cpp
and its StructLayoutTarget class instead of targetingcommon.h
and its Common class.Related: #40
The text was updated successfully, but these errors were encountered: