Skip to content

Commit

Permalink
Cleaned up header inclusion directives in the simulator sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Marochko committed Dec 15, 2019
1 parent 8f15f05 commit ddaa358
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 35 deletions.
17 changes: 7 additions & 10 deletions TPMCmd/Simulator/src/TPMCmdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,26 @@
// of the testing.

//** Includes and Data Definitions
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include "TpmBuildSwitches.h"
#include "BaseTypes.h"

#ifdef _MSC_VER
# pragma warning(push, 3)
# include <windows.h>
# include <winsock.h>
# pragma warning(pop)
#elif defined(__unix__)
# include "BaseTypes.h"
# ifndef TRUE
# define TRUE 1
# endif
# ifndef FALSE
# define FALSE 0
# endif
typedef int SOCKET;
#else
# error "Unsupported platform."
#endif

#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif

#include "Platform_fp.h"
#include "ExecCommand_fp.h"
Expand Down
22 changes: 10 additions & 12 deletions TPMCmd/Simulator/src/TPMCmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,31 @@

//** Includes, Defines, Data Definitions, and Function Prototypes
#include "TpmBuildSwitches.h"
#include "BaseTypes.h"

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <ctype.h>
#include <string.h>

#ifdef _MSC_VER
# pragma warning(push, 3)
# include <windows.h>
# include <winsock.h>
# pragma warning(pop)
#elif defined(__unix__)
# include <stdlib.h>
# include <stdint.h>
# include <string.h>
# include "BaseTypes.h"
# define _strcmpi strcasecmp
# ifndef TRUE
# define TRUE 1
# endif
# ifndef FALSE
# define FALSE 0
# endif
typedef int SOCKET;
#else
# error "Unsupported platform."
#endif

#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif

#include "TpmTcpProtocol.h"
#include "Manufacture_fp.h"
#include "Platform_fp.h"
Expand Down
21 changes: 8 additions & 13 deletions TPMCmd/Simulator/src/TcpServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@
//
//** Includes, Locals, Defines and Function Prototypes
#include "TpmBuildSwitches.h"
#include "BaseTypes.h"
#include <stdio.h>

#ifdef _MSC_VER
# pragma warning(push, 3)
# include <windows.h>
# include <winsock.h>
# pragma warning(pop)
typedef int socklen_t;
typedef int socklen_t;
#elif defined(__unix__)
# include <string.h>
# include <unistd.h>
Expand All @@ -56,28 +55,24 @@ typedef int socklen_t;
# include <netinet/in.h>
# include <sys/socket.h>
# include <pthread.h>
# include "BaseTypes.h"
# define ZeroMemory(ptr, sz) (memset((ptr), 0, (sz)))
# define closesocket(x) close(x)
# define INVALID_SOCKET (-1)
# define SOCKET_ERROR (-1)
# define WSAGetLastError() (errno)
# define INT_PTR intptr_t
# ifndef TRUE
# define TRUE 1
# endif
# ifndef FALSE
# define FALSE 0
# endif
typedef int SOCKET;
#else
# error "Unsupported platform."
#endif

#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif

#include <string.h>
#include <stdlib.h>
#include <stdint.h>

#include "TpmTcpProtocol.h"
#include "Manufacture_fp.h"
#include "TpmProfile.h"
Expand Down

0 comments on commit ddaa358

Please sign in to comment.