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 <stdlib.h> and <string.h> until we know __UD_STANDALONE__
will not be defined.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* (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 <string.h>
-#endif /* __UD_STANDALONE__ */
#include "types.h"
#include "itab.h"
#include "input.h"
#include "decode.h"
+#ifndef __UD_STANDALONE__
+# include <string.h>
+#endif /* __UD_STANDALONE__ */
+
/* The max number of prefixes to an instruction */
#define MAX_PREFIXES 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 <stdlib.h>
-#include <string.h>
-#endif /* __UD_STANDALONE__ */
#include "input.h"
#include "extern.h"
+#ifndef __UD_STANDALONE__
+# include <stdlib.h>
+# include <string.h>
+#endif /* __UD_STANDALONE__ */
+
/* =============================================================================
* ud_init() - Initializes ud_t object.
* =============================================================================