Ticket #13081: fix-tor-0.2.6.1-win32-vs-build-(work.in.progress).diff

File fix-tor-0.2.6.1-win32-vs-build-(work.in.progress).diff, 23.0 KB (added by NewEraCracker, 5 years ago)

Patch to make current alpha version more compatible with VS2010. Still work in progress. Tests need to be fixed.

  • tor-0.2.6.1-alpha/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/Makefile.nmake tor-0.2.6.1-alpha/Makefile.nmake
     
     1# Default configuration is Release
     2!IF "$(CFG)" == ""
     3CFG=Release
     4!ENDIF
     5
     6# Check user supplied configuration to see if it matches any build profile
     7!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     8!MESSAGE Invalid configuration "$(CFG)" specified.
     9!MESSAGE
     10!MESSAGE You can specify a configuration when running NMAKE by defining
     11!MESSAGE the macro CFG on the command line.
     12!MESSAGE
     13!MESSAGE The following configurations are available:
     14!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Release"
     15!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Test"
     16!MESSAGE
     17!MESSAGE To clean build tree the following configurations are available:
     18!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Release"
     19!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Test"
     20!MESSAGE
     21!MESSAGE You are advised to clean your build tree before building a
     22!MESSAGE different profile.
     23!MESSAGE
     24!ERROR An invalid configuration is specified.
     25!ENDIF
     26
    127all:
    228        cd src/common
    3         $(MAKE) /F Makefile.nmake
     29        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    430        cd ../../src/ext
    5         $(MAKE) /F Makefile.nmake
     31        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
     32        cd ../../src/trunnel
     33        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    634        cd ../../src/or
    7         $(MAKE) /F Makefile.nmake
     35        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    836        cd ../../src/test
    9         $(MAKE) /F Makefile.nmake
     37        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
     38        cd ../../src/tools
     39        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    1040
    1141clean:
    1242        cd src/common
    13         $(MAKE) /F Makefile.nmake clean
     43        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1444        cd ../../src/ext
    15         $(MAKE) /F Makefile.nmake clean
     45        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
     46        cd ../../src/trunnel
     47        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1648        cd ../../src/or
    17         $(MAKE) /F Makefile.nmake clean
     49        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1850        cd ../../src/test
    19         $(MAKE) /F Makefile.nmake clean
     51        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
     52        cd ../../src/tools
     53        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
  • tor-0.2.6.1-alpha/src/common/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/common/Makefile.nmake tor-0.2.6.1-alpha/src/common/Makefile.nmake
     
    1 all: libor.lib libor-crypto.lib libor-event.lib
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /I ..\trunnel /I ..\ext\trunnel
     9!ENDIF
     10
     11# Test suite is included in Test version
     12!IF "$(CFG)" == "Test"
     13CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /I ..\trunnel /I ..\ext\trunnel /D"TOR_UNIT_TESTS"
     14!ENDIF
    215
    3 CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
    4     /I ..\ext
     16all: libor.lib libor-crypto.lib libor-event.lib
    517
    618LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
    719        log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
    820        util_codedigest.obj
    921
    1022LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj torgzip.obj tortls.obj \
    11         crypto_curve25519.obj curve25519-donna.obj
     23        crypto_curve25519.obj crypto_ed25519.obj crypto_pwbox.obj crypto_s2k.obj
    1224
    1325LIBOR_EVENT_OBJECTS = compat_libevent.obj
    1426
    15 curve25519-donna.obj: ..\ext\curve25519_donna\curve25519-donna.c
    16         $(CC) $(CFLAGS) /D inline=_inline /c ..\ext\curve25519_donna\curve25519-donna.c
    17 
    1827libor.lib: $(LIBOR_OBJECTS)
    1928        lib $(LIBOR_OBJECTS) /out:libor.lib
    2029
     
    2534        lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
    2635
    2736clean:
    28         del *.obj *.lib libor*.lib
     37        del *.obj libor.lib libor-crypto.lib libor-event.lib
  • tor-0.2.6.1-alpha/src/common/address.c

    diff -uNraw tor-0.2.6.1-alpha/src/common/address.c tor-0.2.6.1-alpha/src/common/address.c
     
    323323{
    324324  uint32_t iph4 = 0;
    325325  uint32_t iph6[4];
     326  sa_family_t v_family;
    326327
    327328  tor_assert(addr);
    328   sa_family_t v_family = tor_addr_family(addr);
     329  v_family = tor_addr_family(addr);
    329330
    330331  if (v_family == AF_INET) {
    331332    iph4 = tor_addr_to_ipv4h(addr);
     
    471472
    472473  if (!strcasecmpend(address, ".ip6.arpa")) {
    473474    const char *cp;
     475    int i;
    474476    int n0, n1;
    475477    struct in6_addr in6;
    476478
     
    478480      return -1;
    479481
    480482    cp = address;
    481     for (int i = 0; i < 16; ++i) {
     483    for (i = 0; i < 16; ++i) {
    482484      n0 = hex_decode_digit(*cp++); /* The low-order nybble appears first. */
    483485      if (*cp++ != '.') return -1;  /* Then a dot. */
    484486      n1 = hex_decode_digit(*cp++); /* The high-order nybble appears first. */
     
    602604  char *endptr;
    603605  int any_flag=0, v4map=0;
    604606  sa_family_t family;
    605   struct in6_addr in6_tmp;
    606   struct in_addr in_tmp = { .s_addr = 0 };
     607  struct in6_addr in6_tmp = {0};
     608  struct in_addr in_tmp = {0};
    607609
    608610  tor_assert(s);
    609611  tor_assert(addr_out);
     
    664666    tor_addr_from_ipv4h(addr_out, 0);
    665667    any_flag = 1;
    666668  } else if (!strcmp(address, "*6") && (flags & TAPMP_EXTENDED_STAR)) {
    667     static char nil_bytes[16] = { [0]=0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
     669    static char nil_bytes[16] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
    668670    family = AF_INET6;
    669671    tor_addr_from_ipv6_bytes(addr_out, nil_bytes);
    670672    any_flag = 1;
  • tor-0.2.6.1-alpha/src/common/backtrace.c

    diff -uNraw tor-0.2.6.1-alpha/src/common/backtrace.c tor-0.2.6.1-alpha/src/common/backtrace.c
     
    55#define _GNU_SOURCE 1
    66
    77#include "orconfig.h"
    8 #include "compat.h"
    9 #include "util.h"
    10 #include "torlog.h"
    118
    129#ifdef HAVE_EXECINFO_H
    1310#include <execinfo.h>
     
    2118#ifdef HAVE_SIGNAL_H
    2219#include <signal.h>
    2320#endif
     21
     22#include "compat.h"
     23#include "util.h"
     24#include "torlog.h"
    2425
    2526#ifdef HAVE_CYGWIN_SIGNAL_H
    2627#include <cygwin/signal.h>
  • tor-0.2.6.1-alpha/src/common/compat.c

    diff -uNraw tor-0.2.6.1-alpha/src/common/compat.c tor-0.2.6.1-alpha/src/common/compat.c
     
    2727#include "compat.h"
    2828
    2929#ifdef _WIN32
     30#include <io.h>
    3031#include <process.h>
    3132#include <windows.h>
    3233#include <sys/locking.h>
  • tor-0.2.6.1-alpha/src/common/crypto.c

    diff -uNraw tor-0.2.6.1-alpha/src/common/crypto.c tor-0.2.6.1-alpha/src/common/crypto.c
     
    2424#undef OCSP_RESPONSE
    2525#endif
    2626
     27#ifdef _MSC_VER
     28#include <openssl/applink.c>
     29#endif
     30
    2731#include <openssl/err.h>
    2832#include <openssl/rsa.h>
    2933#include <openssl/pem.h>
  • tor-0.2.6.1-alpha/src/common/log.c

    diff -uNraw tor-0.2.6.1-alpha/src/common/log.c tor-0.2.6.1-alpha/src/common/log.c
     
    1515// #include <stdio.h>
    1616#include <stdlib.h>
    1717#include <string.h>
     18#ifdef _WIN32
     19#include <io.h>
     20#endif
    1821#ifdef HAVE_SYS_TIME_H
    1922#include <sys/time.h>
    2023#endif
  • tor-0.2.6.1-alpha/src/common/torint.h

    diff -uNraw tor-0.2.6.1-alpha/src/common/torint.h tor-0.2.6.1-alpha/src/common/torint.h
     
    111111typedef unsigned int uint32_t;
    112112#define HAVE_UINT32_T
    113113#endif
     114
     115#ifndef UINT8_MAX
     116#define UINT8_MAX 0xffu
     117#endif
     118#ifndef INT8_MAX
     119#define INT8_MAX 0x7f
     120#endif
     121#ifndef INT8_MIN
     122#define INT8_MIN (-INT8_MAX-1)
     123#endif
    114124#ifndef UINT16_MAX
    115125#define UINT16_MAX 0xffffu
    116126#endif
  • tor-0.2.6.1-alpha/src/ext/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/ext/Makefile.nmake tor-0.2.6.1-alpha/src/ext/Makefile.nmake
     
     1CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
     2
     3all: build-libs build-deps
     4
     5build-libs: csiphash.lib tinytest.lib
     6
     7csiphash.lib: csiphash.obj
     8        lib csiphash.obj /out:csiphash.lib
     9
     10tinytest.lib: tinytest.obj
     11        lib tinytest.obj /out:tinytest.lib
     12
     13build-deps:
     14        cd curve25519_donna
     15        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
     16        cd ../ed25519/ref10
     17        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
     18
     19clean: clean-libs clean-deps
     20
     21clean-libs:
     22        del *.obj *.lib
     23
     24clean-deps:
     25        cd curve25519_donna
     26        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
     27        cd ../ed25519/ref10
     28        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
     29 No newline at end of file
  • tor-0.2.6.1-alpha/src/ext/curve25519_donna/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/ext/curve25519_donna/Makefile.nmake tor-0.2.6.1-alpha/src/ext/curve25519_donna/Makefile.nmake
     
     1CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\..\win32 /I ..\..\common
     2
     3all: curve25519-donna.lib
     4
     5curve25519-donna.obj: curve25519-donna.c
     6        $(CC) $(CFLAGS) /D inline=_inline /c curve25519-donna.c
     7
     8curve25519-donna.lib: curve25519-donna.obj
     9        lib curve25519-donna.obj /out:curve25519-donna.lib
     10
     11clean:
     12        del *.obj *.lib
  • tor-0.2.6.1-alpha/src/ext/ed25519/ref10/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/ext/ed25519/ref10/Makefile.nmake tor-0.2.6.1-alpha/src/ext/ed25519/ref10/Makefile.nmake
     
     1CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\..\..\win32 /I ..\..\..\..\..\build-alpha\include /I ..\..\..\common
     2
     3all: ed25519.lib
     4
     5ED25519_OBJECTS = \
     6        fe_0.obj \
     7        fe_1.obj \
     8        fe_add.obj \
     9        fe_cmov.obj \
     10        fe_copy.obj \
     11        fe_frombytes.obj \
     12        fe_invert.obj \
     13        fe_isnegative.obj \
     14        fe_isnonzero.obj \
     15        fe_mul.obj \
     16        fe_neg.obj \
     17        fe_pow22523.obj \
     18        fe_sq.obj \
     19        fe_sq2.obj \
     20        fe_sub.obj \
     21        fe_tobytes.obj \
     22        ge_add.obj \
     23        ge_double_scalarmult.obj \
     24        ge_frombytes.obj \
     25        ge_madd.obj \
     26        ge_msub.obj \
     27        ge_p1p1_to_p2.obj \
     28        ge_p1p1_to_p3.obj \
     29        ge_p2_0.obj \
     30        ge_p2_dbl.obj \
     31        ge_p3_0.obj \
     32        ge_p3_dbl.obj \
     33        ge_p3_to_cached.obj \
     34        ge_p3_to_p2.obj \
     35        ge_p3_tobytes.obj \
     36        ge_precomp_0.obj \
     37        ge_scalarmult_base.obj \
     38        ge_sub.obj \
     39        ge_tobytes.obj \
     40        keypair.obj \
     41        open.obj \
     42        sc_muladd.obj \
     43        sc_reduce.obj \
     44        sign.obj \
     45        keyconv.obj \
     46        blinding.obj
     47
     48ed25519.lib: $(ED25519_OBJECTS)
     49        lib $(ED25519_OBJECTS) /out:ed25519.lib
     50
     51clean:
     52        del *.obj *.lib
  • tor-0.2.6.1-alpha/src/ext/tinytest.c

    diff -uNraw tor-0.2.6.1-alpha/src/ext/tinytest.c tor-0.2.6.1-alpha/src/ext/tinytest.c
     
    5656#define __attribute__(x)
    5757#endif
    5858
     59#ifdef _MSC_VER
     60#define snprintf _snprintf
     61#endif
     62
    5963#include "tinytest.h"
    6064#include "tinytest_macros.h"
    6165
  • tor-0.2.6.1-alpha/src/ext/trunnel/trunnel-impl.h

    diff -uNraw tor-0.2.6.1-alpha/src/ext/trunnel/trunnel-impl.h tor-0.2.6.1-alpha/src/ext/trunnel/trunnel-impl.h
     
    1818#include "trunnel-local.h"
    1919#endif
    2020
    21 #ifdef _MSC_VER
    22 #define uint8_t unsigned char
    23 #define uint16_t unsigned short
    24 #define uint32_t unsigned int
    25 #define uint64_t unsigned __int64
    26 #define inline __inline
    27 #else
    28 #include <stdint.h>
    29 #endif
     21#include "torint.h"
    3022
    3123#ifdef _WIN32
    3224uint32_t trunnel_htonl(uint32_t a);
  • tor-0.2.6.1-alpha/src/or/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/or/Makefile.nmake tor-0.2.6.1-alpha/src/or/Makefile.nmake
     
    1 all: tor.exe
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
     9!ENDIF
     10
     11# Test suite is included in Test version
     12!IF "$(CFG)" == "Test"
     13CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /D"TOR_UNIT_TESTS"
     14!ENDIF
    215
    3 CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
    4     /I ..\ext
     16all: tor.exe
    517
    6 LIBS = ..\..\..\build-alpha\lib\libevent.lib \
    7  ..\..\..\build-alpha\lib\libcrypto.lib \
    8  ..\..\..\build-alpha\lib\libssl.lib \
    9  ..\..\..\build-alpha\lib\libz.lib \
     18LIBS = ..\..\..\build-alpha\lib\event.lib \
     19 ..\..\..\build-alpha\lib\libeay32.lib \
     20 ..\..\..\build-alpha\lib\ssleay32.lib \
     21 ..\..\..\build-alpha\lib\zdll.lib \
    1022 ws2_32.lib advapi32.lib shell32.lib \
    1123 crypt32.lib gdi32.lib user32.lib
    1224
     
    6779  status.obj \
    6880  transports.obj
    6981
     82EXT_LIBS = \
     83        ..\ext\csiphash.lib \
     84        ..\ext\tinytest.lib \
     85        ..\ext\curve25519_donna\curve25519-donna.lib \
     86        ..\ext\ed25519\ref10\ed25519.lib
     87
    7088libtor.lib: $(LIBTOR_OBJECTS)
    7189        lib $(LIBTOR_OBJECTS) /out:$@
    7290
    7391tor.exe: libtor.lib tor_main.obj
    74         $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib ..\ext\*.lib tor_main.obj /Fe$@
     92        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib tor_main.obj /Fe$@
    7593
    7694clean:
    77         del $(LIBTOR_OBJECTS) tor_main.obj *.lib tor.exe
     95        del $(LIBTOR_OBJECTS) tor_main.obj libtor.lib tor.exe tor.exp tor.lib
  • tor-0.2.6.1-alpha/src/or/directory.c

    diff -uNraw tor-0.2.6.1-alpha/src/or/directory.c tor-0.2.6.1-alpha/src/or/directory.c
     
    34423442void
    34433443download_status_reset(download_status_t *dls)
    34443444{
    3445   if (dls->n_download_failures == IMPOSSIBLE_TO_DOWNLOAD)
     3445  if (dls->n_download_failures == IMPOSSIBLE_TO_DOWNLOAD) {
    34463446    return; /* Don't reset this. */
    3447 
     3447  }
     3448  {
    34483449  const smartlist_t *schedule = find_dl_schedule_and_len(
    34493450                          dls, get_options()->DirPort_set);
    34503451
    34513452  dls->n_download_failures = 0;
    34523453  dls->next_attempt_at = time(NULL) + *(int *)smartlist_get(schedule, 0);
     3454  }
    34533455}
    34543456
    34553457/** Return the number of failures on <b>dls</b> since the last success (if
  • tor-0.2.6.1-alpha/src/or/routerlist.c

    diff -uNraw tor-0.2.6.1-alpha/src/or/routerlist.c tor-0.2.6.1-alpha/src/or/routerlist.c
     
    39333933      }
    39343934      smartlist_string_remove(requested_fingerprints, fp);
    39353935    }
     3936    {
    39363937    download_status_t *dls;
    39373938    dls = router_get_dl_status_by_descriptor_digest((char*)bad_digest);
    39383939    if (dls) {
     
    39403941               "and therefore undownloadable", fp);
    39413942      download_status_mark_impossible(dls);
    39423943    }
     3944    }
    39433945  } SMARTLIST_FOREACH_END(bad_digest);
    39443946  SMARTLIST_FOREACH(invalid_digests, uint8_t *, d, tor_free(d));
    39453947  smartlist_free(invalid_digests);
     
    39773979  SMARTLIST_FOREACH_BEGIN(extrainfo_list, extrainfo_t *, ei) {
    39783980      uint8_t d[DIGEST_LEN];
    39793981      memcpy(d, ei->cache_info.signed_descriptor_digest, DIGEST_LEN);
     3982      {
    39803983      was_router_added_t added =
    39813984        router_add_extrainfo_to_routerlist(ei, &msg, from_cache, !from_cache);
    39823985      if (WRA_WAS_ADDED(added) && requested_fingerprints) {
     
    39994002          download_status_mark_impossible(&sd->ei_dl_status);
    40004003        }
    40014004      }
     4005      }
    40024006  } SMARTLIST_FOREACH_END(ei);
    40034007
    40044008  SMARTLIST_FOREACH_BEGIN(invalid_digests, const uint8_t *, bad_digest) {
     
    40124016      }
    40134017      smartlist_string_remove(requested_fingerprints, fp);
    40144018    }
     4019    {
    40154020    signed_descriptor_t *sd =
    40164021      router_get_by_extrainfo_digest((char*)bad_digest);
    40174022    if (sd) {
    40184023      log_info(LD_GENERAL, "Marking extrainfo with descriptor %s as "
    40194024               "unparseable, and therefore undownloadable", fp);
    40204025      download_status_mark_impossible(&sd->ei_dl_status);
     4026      }
    40214027    }
    40224028  } SMARTLIST_FOREACH_END(bad_digest);
    40234029  SMARTLIST_FOREACH(invalid_digests, uint8_t *, d, tor_free(d));
  • tor-0.2.6.1-alpha/src/test/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/test/Makefile.nmake tor-0.2.6.1-alpha/src/test/Makefile.nmake
     
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8all: bench.exe
     9CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
     10!ENDIF
     11
     12# Test suite is included in Test version
     13!IF "$(CFG)" == "Test"
     14all: bench.exe test.exe test_bt_cl.exe test_ntor_cl.exe test-child.exe
     15CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /D"TOR_UNIT_TESTS"
     16!ENDIF
     17
     18LIBS = ..\..\..\build-alpha\lib\event.lib \
     19 ..\..\..\build-alpha\lib\libeay32.lib \
     20 ..\..\..\build-alpha\lib\ssleay32.lib \
     21 ..\..\..\build-alpha\lib\zdll.lib \
     22 ws2_32.lib advapi32.lib shell32.lib \
     23 crypt32.lib gdi32.lib user32.lib
     24
     25EXT_LIBS = \
     26        ..\ext\csiphash.lib \
     27        ..\ext\tinytest.lib \
     28        ..\ext\curve25519_donna\curve25519-donna.lib \
     29        ..\ext\ed25519\ref10\ed25519.lib
     30
     31TEST_OBJECTS = \
     32  test.obj                   \
     33  test_accounting.obj        \
     34  test_addr.obj              \
     35  test_buffers.obj           \
     36  test_cell_formats.obj      \
     37  test_cell_queue.obj        \
     38  test_circuitlist.obj       \
     39  test_circuitmux.obj        \
     40  test_config.obj            \
     41  test_containers.obj        \
     42  test_controller_events.obj \
     43# test_crypto.obj            \
     44  test_data.obj              \
     45# test_dir.obj               \
     46  test_entrynodes.obj        \
     47  test_extorport.obj         \
     48  test_hs.obj                \
     49  test_introduce.obj         \
     50  test_logging.obj           \
     51# test_microdesc.obj         \
     52  test_nodelist.obj          \
     53  test_oom.obj               \
     54  test_options.obj           \
     55  test_policy.obj            \
     56  test_pt.obj                \
     57  test_relaycell.obj         \
     58  test_replay.obj            \
     59  test_routerkeys.obj        \
     60  test_routerset.obj         \
     61  test_socks.obj             \
     62  test_status.obj            \
     63  test_util.obj
     64
     65bench.exe: bench.obj
     66        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) ..\or\libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib bench.obj /Fe$@
     67
     68test.exe: $(TEST_OBJECTS)
     69        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) ..\or\libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib $(TEST_OBJECTS) /Fe$@
     70
     71test_bt_cl.exe: test_bt_cl.obj
     72        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) ..\or\libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib test_bt_cl.obj /Fe$@
     73
     74test_ntor_cl.exe: test_ntor_cl.obj
     75        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) ..\or\libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib test_ntor_cl.obj /Fe$@
     76
     77test-child.exe: test-child.obj
     78        $(CC) $(CFLAGS) $(LIBS) $(EXT_LIBS) ..\or\libtor.lib ..\common\*.lib ..\trunnel\trunnel.lib test-child.obj /Fe$@
     79
     80clean:
     81        del $(TEST_OBJECTS) *.exe *.exp *.lib *.obj
  • tor-0.2.6.1-alpha/src/test/test_bt_cl.c

    diff -uNraw tor-0.2.6.1-alpha/src/test/test_bt_cl.c tor-0.2.6.1-alpha/src/test/test_bt_cl.c
     
    1818#ifdef __GNUC__
    1919#define NOINLINE __attribute__((noinline))
    2020#define NORETURN __attribute__((noreturn))
     21#else
     22#define NOINLINE
     23#define NORETURN
    2124#endif
    2225
    2326int crash(int x) NOINLINE;
  • tor-0.2.6.1-alpha/src/tools/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/tools/Makefile.nmake tor-0.2.6.1-alpha/src/tools/Makefile.nmake
     
     1all: tor-checkkey.exe tor-gencert.exe tor-resolve.exe
     2
     3CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
     4
     5LIBS = ..\..\..\build-alpha\lib\event.lib \
     6 ..\..\..\build-alpha\lib\libeay32.lib \
     7 ..\..\..\build-alpha\lib\ssleay32.lib \
     8 ..\..\..\build-alpha\lib\zdll.lib \
     9 ws2_32.lib advapi32.lib shell32.lib \
     10 crypt32.lib gdi32.lib user32.lib
     11
     12tor-checkkey.exe: tor-checkkey.obj
     13        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-checkkey.obj /Fe$@
     14
     15tor-gencert.exe: tor-gencert.obj
     16        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-gencert.obj /Fe$@
     17
     18tor-resolve.exe: tor-resolve.obj
     19        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-resolve.obj /Fe$@
     20
     21clean:
     22        del tor-checkkey.obj tor-gencert.obj tor-resolve.obj \
     23                tor-checkkey.lib tor-gencert.lib tor-resolve.lib \
     24                tor-checkkey.exe tor-gencert.exe tor-resolve.exe \
     25                tor-checkkey.exp tor-gencert.exp
  • tor-0.2.6.1-alpha/src/trunnel/Makefile.nmake

    diff -uNraw tor-0.2.6.1-alpha/src/trunnel/Makefile.nmake tor-0.2.6.1-alpha/src/trunnel/Makefile.nmake
     
     1CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\common /I ..\ext\trunnel
     2
     3all: trunnel.lib
     4
     5trunnel.lib: trunnel.obj pwbox.obj
     6        lib trunnel.obj pwbox.obj /out:trunnel.lib
     7
     8pwbox.obj: pwbox.c
     9        $(CC) $(CFLAGS) /D inline=_inline /c pwbox.c
     10
     11trunnel.obj: ..\ext\trunnel\trunnel.c
     12        $(CC) $(CFLAGS) /D inline=_inline /c ..\ext\trunnel\trunnel.c
     13
     14clean:
     15        del *.obj *.lib
  • tor-0.2.6.1-alpha/src/trunnel/pwbox.h

    diff -uNraw tor-0.2.6.1-alpha/src/trunnel/pwbox.h tor-0.2.6.1-alpha/src/trunnel/pwbox.h
     
    55#ifndef TRUNNEL_PWBOX_H
    66#define TRUNNEL_PWBOX_H
    77
    8 #include <stdint.h>
     8#include "torint.h"
    99#include "trunnel.h"
    1010
    1111#define PWBOX0_CONST0 1414484546
  • tor-0.2.6.1-alpha/src/win32/orconfig.h

    diff -uNraw tor-0.2.6.1-alpha/src/win32/orconfig.h tor-0.2.6.1-alpha/src/win32/orconfig.h
     
    8989/* Define to 1 if you have the `strlcpy' function. */
    9090#undef HAVE_STRLCPY
    9191
     92/* Define to 1 if you have the `strnlen' function. */
     93#define HAVE_STRNLEN
     94
    9295/* Define to 1 if you have the `strptime' function. */
    9396#undef HAVE_STRPTIME
    9497
     
    247250#define USE_CURVE25519_DONNA
    248251
    249252#define ENUM_VALS_ARE_SIGNED 1
     253
     254#define HAVE_EXTERN_ENVIRON_DECLARED
    250255
    251256#ifndef STDOUT_FILENO
    252257#define STDOUT_FILENO 1