cleanup programs
Clean up the contents of programs, add more guards to includes, move all
defines to the top of the top of files, remove some unused includes
diff --git a/programs/hash/generic_sum.c b/programs/hash/generic_sum.c
index 20ff252..9183874 100644
--- a/programs/hash/generic_sum.c
+++ b/programs/hash/generic_sum.c
@@ -29,22 +29,25 @@
#if defined(POLARSSL_PLATFORM_C)
#include "polarssl/platform.h"
#else
-#define polarssl_printf printf
+#include <stdio.h>
#define polarssl_fprintf fprintf
+#define polarssl_printf printf
#endif
-#include <string.h>
-#include <stdio.h>
-
+#if defined(POLARSSL_MD_C) && defined(POLARSSL_FS_IO)
#include "polarssl/md.h"
-#if !defined(POLARSSL_MD_C)
+#include <stdio.h>
+#include <string.h>
+#endif
+
+#if !defined(POLARSSL_MD_C) || !defined(POLARSSL_FS_IO)
int main( int argc, char *argv[] )
{
((void) argc);
((void) argv);
- polarssl_printf("POLARSSL_MD_C not defined.\n");
+ polarssl_printf("POLARSSL_MD_C and/or POLARSSL_FS_IO not defined.\n");
return( 0 );
}
#else
@@ -225,4 +228,4 @@
return( ret );
}
-#endif /* POLARSSL_MD_C */
+#endif /* POLARSSL_MD_C && POLARSSL_FS_IO */