Skip to content

Commit

Permalink
Move e_os.h to be the very first include.
Browse files Browse the repository at this point in the history
cryptilib.h is the second.

Reviewed-by: Andy Polyakov <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#4188)
  • Loading branch information
paulidale committed Aug 29, 2017
1 parent 9590da2 commit 07016a8
Show file tree
Hide file tree
Showing 39 changed files with 43 additions and 59 deletions.
2 changes: 1 addition & 1 deletion apps/apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#ifndef HEADER_APPS_H
# define HEADER_APPS_H

# include "internal/nelem.h"
# include "e_os.h"
# include "internal/nelem.h"
# if defined(__unix) || defined(__unix__)
# include <sys/time.h> /* struct timeval for DTLS */
# endif
Expand Down
2 changes: 1 addition & 1 deletion apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "e_os.h"
#include <openssl/e_os2.h>

#ifndef OPENSSL_NO_SOCK
Expand Down
5 changes: 2 additions & 3 deletions crypto/bio/bss_bio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
Expand All @@ -15,6 +15,7 @@
* See ssl/ssltest.c for some hints on how this can be used.
*/

#include "e_os.h"
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
Expand All @@ -24,8 +25,6 @@
#include <openssl/err.h>
#include <openssl/crypto.h>

#include "e_os.h"

static int bio_new(BIO *bio);
static int bio_free(BIO *bio);
static int bio_read(BIO *bio, char *buf, int size);
Expand Down
3 changes: 1 addition & 2 deletions crypto/blake2/blake2b.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
Expand All @@ -17,7 +17,6 @@
#include <assert.h>
#include <string.h>
#include <openssl/crypto.h>
#include "e_os.h"

#include "blake2_locl.h"
#include "blake2_impl.h"
Expand Down
3 changes: 1 addition & 2 deletions crypto/blake2/blake2s.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
Expand All @@ -17,7 +17,6 @@
#include <assert.h>
#include <string.h>
#include <openssl/crypto.h>
#include "e_os.h"

#include "blake2_locl.h"
#include "blake2_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion crypto/conf/conf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

/* Part of the code in here was originally in conf.c, which is now removed */

#include "e_os.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include "e_os.h"

static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);
Expand Down
2 changes: 1 addition & 1 deletion crypto/conf/conf_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <stdio.h>
#include <string.h>
#include "internal/conf.h"
Expand All @@ -15,7 +16,6 @@
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include <openssl/lhash.h>
#include "e_os.h"

static CONF_METHOD *default_CONF_method = NULL;

Expand Down
3 changes: 1 addition & 2 deletions crypto/conf/conf_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
* https://www.openssl.org/source/license.html
*/

#include "internal/cryptlib.h"
#include <stdio.h>
#include <ctype.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "e_os.h"
#include "internal/conf.h"
#include "internal/dso.h"
#include <openssl/x509.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/cryptlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* https://www.openssl.org/source/license.html
*/

#include "internal/cryptlib_int.h"
#include "e_os.h"
#include "internal/cryptlib_int.h"
#include <openssl/safestack.h>

#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
Expand Down
1 change: 0 additions & 1 deletion crypto/des/cfb64ede.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#include "des_locl.h"
#include "e_os.h"

/*
* The input and output encrypted as though 64bit cfb mode is being used.
Expand Down
2 changes: 1 addition & 1 deletion crypto/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include "internal/cryptlib_int.h"
#include "e_os.h"
#include "internal/cryptlib_int.h"

#if defined(_WIN32) || defined(__CYGWIN__)
# ifdef __CYGWIN__
Expand Down
3 changes: 1 addition & 2 deletions crypto/engine/eng_devcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand All @@ -15,8 +16,6 @@
#include <unistd.h>
#include <assert.h>

#include "e_os.h"

#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/engine.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/engine/eng_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include "eng_int.h"
#include "e_os.h"
#include "eng_int.h"

/*
* Initialise a engine type for use (or up its functional reference count if
Expand Down
2 changes: 1 addition & 1 deletion crypto/engine/eng_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include "eng_int.h"
#include "e_os.h"
#include "eng_int.h"
#include <openssl/rand.h>
#include "internal/refcount.h"

Expand Down
2 changes: 1 addition & 1 deletion crypto/engine/tb_asnmth.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include "eng_int.h"
#include "e_os.h"
#include "eng_int.h"
#include <openssl/evp.h>
#include "internal/asn1_int.h"

Expand Down
2 changes: 1 addition & 1 deletion crypto/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include "internal/cryptlib_int.h"
#include <openssl/err.h>
#include "internal/rand_int.h"
Expand All @@ -25,7 +26,6 @@
#include "internal/thread_once.h"
#include "internal/dso.h"
#include "internal/store.h"
#include "e_os.h"

static int stopped = 0;

Expand Down
6 changes: 3 additions & 3 deletions crypto/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include "internal/cryptlib.h"
#include "internal/cryptlib_int.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <openssl/crypto.h>
#include "e_os.h"
#include "internal/cryptlib.h"
#include "internal/cryptlib_int.h"
#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
# include <execinfo.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion crypto/mem_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* For details on that implementation, see below (look for uppercase
* "SECURE HEAP IMPLEMENTATION").
*/
#include <openssl/crypto.h>
#include "e_os.h"
#include <openssl/crypto.h>

#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/o_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include <errno.h>
#include "e_os.h"
#include <errno.h>

/*
* The routines really come from the Levitte Programming, so to make life
Expand Down
2 changes: 1 addition & 1 deletion crypto/o_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include <limits.h>
#include "e_os.h"
#include <limits.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "internal/o_str.h"
Expand Down
2 changes: 1 addition & 1 deletion crypto/ocsp/ocsp_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <stdio.h>
#include <stdlib.h>
#include "internal/ctype.h"
#include <string.h>
#include "e_os.h"
#include <openssl/asn1.h>
#include <openssl/ocsp.h>
#include <openssl/err.h>
Expand Down
3 changes: 1 addition & 2 deletions crypto/rand/rand_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
* https://www.openssl.org/source/license.html
*/

#include <stdio.h>

#include "e_os.h"
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/rand.h>
#include "rand_lcl.h"
Expand Down
3 changes: 1 addition & 2 deletions crypto/store/loader_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <string.h>
#include <sys/stat.h>
#include <assert.h>
Expand All @@ -29,8 +30,6 @@
#include "internal/store_int.h"
#include "store_locl.h"

#include "e_os.h"

#ifdef _WIN32
# define stat _stat
#endif
Expand Down
4 changes: 1 addition & 3 deletions crypto/store/store_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <stdlib.h>
#include <string.h>

#include "e_os.h"

#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/store.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/ui/ui_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <openssl/e_os2.h>
#include <openssl/err.h>
#include <openssl/ui.h>
#include "e_os.h"

#ifndef OPENSSL_NO_UI_CONSOLE
/*
Expand Down
5 changes: 2 additions & 3 deletions crypto/x509/by_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include "internal/cryptlib.h"
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <sys/types.h>

#include "internal/cryptlib.h"
#include "e_os.h"

#ifndef OPENSSL_NO_POSIX_IO
# include <sys/stat.h>
#endif
Expand Down
3 changes: 1 addition & 2 deletions crypto/x509v3/v3_ncons.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
*/

#include "e_os.h" /* for strncasecmp */
#include <stdio.h>
#include "internal/cryptlib.h"
#include "e_os.h"
#include <stdio.h>
#include "internal/asn1_int.h"
#include <openssl/asn1t.h>
#include <openssl/conf.h>
Expand Down
4 changes: 2 additions & 2 deletions crypto/x509v3/v3_tlsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* https://www.openssl.org/source/license.html
*/

#include <stdio.h>
#include "internal/cryptlib.h"
#include "e_os.h"
#include "internal/cryptlib.h"
#include <stdio.h>
#include "internal/o_str.h"
#include <openssl/asn1t.h>
#include <openssl/conf.h>
Expand Down
4 changes: 2 additions & 2 deletions crypto/x509v3/v3_utl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

/* X509 v3 extension utilities */

#include "e_os.h"
#include "internal/cryptlib.h"
#include <stdio.h>
#include "internal/ctype.h"
#include "internal/cryptlib.h"
#include "e_os.h"
#include <openssl/conf.h>
#include <openssl/x509v3.h>
#include "internal/x509_int.h"
Expand Down
1 change: 1 addition & 0 deletions e_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef HEADER_E_OS_H
# define HEADER_E_OS_H

# include <limits.h>
# include <openssl/opensslconf.h>

# include <openssl/e_os2.h>
Expand Down
2 changes: 1 addition & 1 deletion ssl/d1_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* https://www.openssl.org/source/license.html
*/

#include "e_os.h"
#include <stdio.h>
#include <openssl/objects.h>
#include <openssl/rand.h>
#include "ssl_locl.h"
#include "e_os.h"

#if defined(OPENSSL_SYS_VXWORKS)
# include <sys/times.h>
Expand Down
Loading

0 comments on commit 07016a8

Please sign in to comment.