浏览代码

Clang imposed changes in thirdparty that should be noop and have no effect on classic compiler (3rd after 74fdf539)

Source commit: adaaa520f1fcbdfcfd84d92013249a049d1ee303
Martin Prikryl 2 月之前
父节点
当前提交
cea3db7f78

+ 4 - 2
libs/Makefile.inc

@@ -1,5 +1,7 @@
 CC = "$(BDS)\bin\bcc32"
 CC = "$(BDS)\bin\bcc32"
 MKLIB = "$(BDS)\bin\tlib" /a /C
 MKLIB = "$(BDS)\bin\tlib" /a /C
-CFLAG_COMMON=-O2 -c -fp -tWM
+CFLAG_BASE=-O2 -c -fp -tWM
 # These are defaults anyway
 # These are defaults anyway
-CFLAG_COMMON=$(CFLAG_COMMON) -a8 -vi -ff
+CFLAG_BASE=$(CFLAG_BASE) -a8 -vi -ff
+CFLAG_COMMON=$(CFLAG_BASE)
+CFLAG_CPP=$(CFLAG_BASE) /P

+ 2 - 3
libs/libs3/Makefile

@@ -3,9 +3,8 @@
 # Set your compiler options
 # Set your compiler options
 DEFINES = WIN32;WIN32_LEAN_AND_MEAN;WINSCP;NE_LFS
 DEFINES = WIN32;WIN32_LEAN_AND_MEAN;WINSCP;NE_LFS
 WARNINGS = -w-aus -w-par
 WARNINGS = -w-aus -w-par
-# Compile like C++ (it's probably only to support newer features and won't be needed with Clang)
-CFLAG = -P
-CFLAG = $(CFLAG_COMMON) $(CFLAG) -D$(DEFINES:;= -D) $(WARNINGS)
+# Compile like C++
+CFLAG = $(CFLAG_CPP) -D$(DEFINES:;= -D) $(WARNINGS)
 # The output directory for all the temporary muck
 # The output directory for all the temporary muck
 TMP_D=tmp
 TMP_D=tmp
 
 

+ 3 - 3
libs/libs3/src/object.c

@@ -68,7 +68,7 @@ void S3_put_object(const S3BucketContext *bucketContext, const char *key,
         putProperties,                                // putProperties
         putProperties,                                // putProperties
         handler->responseHandler.propertiesCallback,  // propertiesCallback
         handler->responseHandler.propertiesCallback,  // propertiesCallback
         handler->putObjectDataCallback,               // toS3Callback
         handler->putObjectDataCallback,               // toS3Callback
-        contentLength,                                // toS3CallbackTotalSize
+        static_cast<int64_t>(contentLength),          // toS3CallbackTotalSize (WINSCP cast)
         0,                                            // fromS3Callback
         0,                                            // fromS3Callback
         handler->responseHandler.completeCallback,    // completeCallback
         handler->responseHandler.completeCallback,    // completeCallback
         callbackData,                                 // callbackData
         callbackData,                                 // callbackData
@@ -302,8 +302,8 @@ void S3_get_object(const S3BucketContext *bucketContext, const char *key,
         0,                                            // copySourceBucketName
         0,                                            // copySourceBucketName
         0,                                            // copySourceKey
         0,                                            // copySourceKey
         getConditions,                                // getConditions
         getConditions,                                // getConditions
-        startByte,                                    // startByte
-        byteCount,                                    // byteCount
+        static_cast<size_t>(startByte),               // startByte (WINSCP cast)
+        static_cast<size_t>(byteCount),               // byteCount (WINSCP cast)
         0,                                            // putProperties
         0,                                            // putProperties
         handler->responseHandler.propertiesCallback,  // propertiesCallback
         handler->responseHandler.propertiesCallback,  // propertiesCallback
         0,                                            // toS3Callback
         0,                                            // toS3Callback

+ 1 - 1
libs/mfc/include/afx.h

@@ -58,7 +58,7 @@
 #pragma warning(disable: 4390)  // empty controlled statement
 #pragma warning(disable: 4390)  // empty controlled statement
 #endif //!ALL_WARNINGS
 #endif //!ALL_WARNINGS
 
 
-#define UNUSED(x) x
+#define UNUSED(x) (static_cast<const void *>(&x) == static_cast<const void *>(&x))
 
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Basic object model
 // Basic object model

+ 1 - 1
libs/mfc/source/borland.mak

@@ -41,7 +41,7 @@ OBJS=$(CPP_OBJS)
 # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
 # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
 # Define rule for use with OBJ directory
 # Define rule for use with OBJ directory
 
 
-CPPFLAGS=$(CFLAG_COMMON) $(CL_OPT) -D$(DEFS:;= -D)
+CPPFLAGS=$(CFLAG_CPP) $(CL_OPT) -D$(DEFS:;= -D)
 
 
 BORFLAGS=$(CPPFLAGS) -I$(INCL:;= -I)
 BORFLAGS=$(CPPFLAGS) -I$(INCL:;= -I)
 
 

+ 3 - 2
libs/openssl/Makefile

@@ -33,8 +33,9 @@ CFLAG=$(CFLAG) -D$(DEFINES:;= -D)
 
 
 # Copied from generated OpenSSL "makefile"
 # Copied from generated OpenSSL "makefile"
 # (but the OPENSSL_BUILDING_OPENSSL, _stricmp, _strnicmp and _setmode are not needed)
 # (but the OPENSSL_BUILDING_OPENSSL, _stricmp, _strnicmp and _setmode are not needed)
+# (and DSO_WIN32 removed as it clashes with dso_conf.h)
 CFLAG= $(CFLAG) \
 CFLAG= $(CFLAG) \
-    -D"OPENSSL_BUILDING_OPENSSL" -D"WIN32_LEAN_AND_MEAN" -D"OPENSSL_SYS_WIN32" -D"L_ENDIAN" -D"DSO_WIN32" \
+    -D"OPENSSL_BUILDING_OPENSSL" -D"WIN32_LEAN_AND_MEAN" -D"OPENSSL_SYS_WIN32" -D"L_ENDIAN" \
     -D"_stricmp=stricmp" -D"_strnicmp=strnicmp" -D"_malloca=malloc" -D"_freea=free" -D"_setmode=setmode" \
     -D"_stricmp=stricmp" -D"_strnicmp=strnicmp" -D"_malloca=malloc" -D"_freea=free" -D"_setmode=setmode" \
     -D"NDEBUG"
     -D"NDEBUG"
 
 
@@ -70,7 +71,7 @@ O_CRYPTO=  $(OUT_D)\$(CRYPTO).lib
 # Don't touch anything below this point
 # Don't touch anything below this point
 ######################################################
 ######################################################
 
 
-INC=-Iinclude -Icommon\include -Iproviders\implementations\include -Iproviders\common\include
+INC=-Iinclude -Icommon\include -Iproviders\implementations\include -Iproviders\common\include -I.
 LIB_CFLAGS=$(CFLAG) $(INC)
 LIB_CFLAGS=$(CFLAG) $(INC)
 LIBS_DEP=$(O_CRYPTO) $(O_SSL)
 LIBS_DEP=$(O_CRYPTO) $(O_SSL)
 
 

+ 2 - 0
libs/openssl/crypto/conf/conf_mod.c

@@ -48,7 +48,9 @@
 #define ossl_rcu_write_unlock CRYPTO_THREAD_unlock
 #define ossl_rcu_write_unlock CRYPTO_THREAD_unlock
 #define ossl_rcu_read_unlock CRYPTO_THREAD_unlock
 #define ossl_rcu_read_unlock CRYPTO_THREAD_unlock
 #define ossl_synchronize_rcu(lock)
 #define ossl_synchronize_rcu(lock)
+#undef ossl_rcu_deref
 #define ossl_rcu_deref(p) (*(p))
 #define ossl_rcu_deref(p) (*(p))
+#undef ossl_rcu_assign_ptr
 #define ossl_rcu_assign_ptr(p, v) (*(p)) = (*(v))
 #define ossl_rcu_assign_ptr(p, v) (*(p)) = (*(v))
 
 
 #endif // WINSCP
 #endif // WINSCP