Removed a few more unused configuration macros.
authorRoman Donchenko <roman.donchenko@itseez.com>
Wed, 10 Jul 2013 13:43:46 +0000 (17:43 +0400)
committerRoman Donchenko <roman.donchenko@itseez.com>
Wed, 10 Jul 2013 14:29:11 +0000 (18:29 +0400)
I've left HAVE_LIBPTHREAD as a CMake variable, since TBB's build depends on it.

Some macros in internal.hpp depended on HAVE_ALLOCA_H, but they were, in turn,
unused, so I've just deleted them all.

CMakeLists.txt
cmake/templates/cvconfig.h.cmake
modules/core/include/opencv2/core/internal.hpp
modules/core/src/persistence.cpp
modules/core/src/system.cpp
modules/highgui/src/grfmt_png.cpp

index 444f3d7..b4a6a5f 100644 (file)
@@ -369,9 +369,6 @@ if(UNIX)
   include(CheckIncludeFile)
 
   if(NOT APPLE)
-    CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)
-    CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
-    CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
     CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
     if(ANDROID)
       set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
@@ -381,7 +378,7 @@ if(UNIX)
       set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
     endif()
   else()
-    add_definitions(-DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H)
+    set(HAVE_LIBPTHREAD YES)
   endif()
 endif()
 
index 0b93d8a..a1b97e5 100644 (file)
@@ -1,10 +1,3 @@
-/* Define to 1 if you have `alloca', as a function or macro. */
-#cmakedefine HAVE_ALLOCA 1
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#cmakedefine HAVE_ALLOCA_H 1
-
 /* Video for Windows support */
 #cmakedefine HAVE_VFW
 
@@ -71,9 +64,6 @@
 /* libpng/png.h needs to be included */
 #cmakedefine  HAVE_LIBPNG_PNG_H
 
-/* Define to 1 if you have the `pthread' library (-lpthread). */
-#cmakedefine  HAVE_LIBPTHREAD 1
-
 /* Define to 1 if you have the `lrint' function. */
 #cmakedefine  HAVE_LRINT 1
 
@@ -95,9 +85,6 @@
 /* Unicap video capture library */
 #cmakedefine  HAVE_UNICAP
 
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine  HAVE_UNISTD_H 1
-
 /* Xine video library */
 #cmakedefine  HAVE_XINE
 
index 606c62f..5e8a03b 100644 (file)
@@ -340,25 +340,6 @@ namespace cv
 *                                  Common declarations                                   *
 \****************************************************************************************/
 
-/* get alloca declaration */
-#ifdef __GNUC__
-#  undef alloca
-#  define alloca __builtin_alloca
-#  define CV_HAVE_ALLOCA 1
-#elif defined WIN32 || defined _WIN32 || \
-      defined WINCE || defined _MSC_VER || defined __BORLANDC__
-#  include <malloc.h>
-#  define CV_HAVE_ALLOCA 1
-#elif defined HAVE_ALLOCA_H
-#  include <alloca.h>
-#  define CV_HAVE_ALLOCA 1
-#elif defined HAVE_ALLOCA
-#  include <stdlib.h>
-#  define CV_HAVE_ALLOCA 1
-#else
-#  undef CV_HAVE_ALLOCA
-#endif
-
 #ifdef __GNUC__
 #  define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x)))
 #elif defined _MSC_VER
@@ -367,11 +348,6 @@ namespace cv
 #  define CV_DECL_ALIGNED(x)
 #endif
 
-#if CV_HAVE_ALLOCA
-/* ! DO NOT make it an inline function */
-#  define cvStackAlloc(size) cvAlignPtr( alloca((size) + CV_MALLOC_ALIGN), CV_MALLOC_ALIGN )
-#endif
-
 #ifndef CV_IMPL
 #  define CV_IMPL CV_EXTERN_C
 #endif
index a16b63e..bf6a64c 100644 (file)
@@ -59,7 +59,6 @@
 #endif
 
 #if USE_ZLIB
-#  undef HAVE_UNISTD_H //to avoid redefinition
 #  ifndef _LFS64_LARGEFILE
 #    define _LFS64_LARGEFILE 0
 #  endif
index a891e94..7cc5f04 100644 (file)
@@ -469,40 +469,6 @@ redirectError( CvErrorCallback errCallback, void* userdata, void** prevUserdata)
 
 }
 
-/*CV_IMPL int
-cvGuiBoxReport( int code, const char *func_name, const char *err_msg,
-                const char *file, int line, void* )
-{
-#if (!defined WIN32 && !defined _WIN32) || defined WINCE
-    return cvStdErrReport( code, func_name, err_msg, file, line, 0 );
-#else
-    if( code != CV_StsBackTrace && code != CV_StsAutoTrace )
-    {
-        size_t msg_len = strlen(err_msg ? err_msg : "") + 1024;
-        char* message = (char*)alloca(msg_len);
-        char title[100];
-
-        wsprintf( message, "%s (%s)\nin function %s, %s(%d)\n\n"
-                  "Press \"Abort\" to terminate application.\n"
-                  "Press \"Retry\" to debug (if the app is running under debugger).\n"
-                  "Press \"Ignore\" to continue (this is not safe).\n",
-                  cvErrorStr(code), err_msg ? err_msg : "no description",
-                  func_name, file, line );
-
-        wsprintf( title, "OpenCV GUI Error Handler" );
-
-        int answer = MessageBox( NULL, message, title, MB_ICONERROR|MB_ABORTRETRYIGNORE|MB_SYSTEMMODAL );
-
-        if( answer == IDRETRY )
-        {
-            CV_DBG_BREAK();
-        }
-        return answer != IDIGNORE;
-    }
-    return 0;
-#endif
-}*/
-
 CV_IMPL int cvCheckHardwareSupport(int feature)
 {
     CV_DbgAssert( 0 <= feature && feature <= CV_HARDWARE_MAX_FEATURE );
@@ -904,4 +870,4 @@ bool Mutex::trylock() { return impl->trylock(); }
 
 }
 
-/* End of file. */
\ No newline at end of file
+/* End of file. */
index 9bb5d32..fb0fe6c 100644 (file)
@@ -51,7 +51,6 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
-#undef HAVE_UNISTD_H //to avoid redefinition
 #ifndef _LFS64_LARGEFILE
 #  define _LFS64_LARGEFILE 0
 #endif