From cc971d966c727745a61f4b5803131b487b667e33 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 4 May 2009 18:45:13 -0400 Subject: [PATCH] Wait to include system headers until we know they are wanted. When building in the Linux kernel, __UD_STANDALONE__ is not defined until types.h is included. So we should wait to include system headers like and until we know __UD_STANDALONE__ will not be defined. Signed-off-by: Anders Kaseorg --- libudis86/decode.c | 7 ++++--- libudis86/udis86.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libudis86/decode.c b/libudis86/decode.c index 90f6c05..3af2f7d 100644 --- a/libudis86/decode.c +++ b/libudis86/decode.c @@ -23,15 +23,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __UD_STANDALONE__ -# include -#endif /* __UD_STANDALONE__ */ #include "types.h" #include "itab.h" #include "input.h" #include "decode.h" +#ifndef __UD_STANDALONE__ +# include +#endif /* __UD_STANDALONE__ */ + /* The max number of prefixes to an instruction */ #define MAX_PREFIXES 15 diff --git a/libudis86/udis86.c b/libudis86/udis86.c index 135ef59..9421863 100644 --- a/libudis86/udis86.c +++ b/libudis86/udis86.c @@ -23,14 +23,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __UD_STANDALONE__ -#include -#include -#endif /* __UD_STANDALONE__ */ #include "input.h" #include "extern.h" +#ifndef __UD_STANDALONE__ +# include +# include +#endif /* __UD_STANDALONE__ */ + /* ============================================================================= * ud_init() - Initializes ud_t object. * ============================================================================= -- 2.45.1