Create a header where to keep an unique definition of UNUSED

v0.27.3
Luis Diaz Mas 7 years ago committed by Luis Díaz Más
parent 9fa4c62561
commit 773bdfd14e

@ -40,6 +40,7 @@ foreach(entry ${SAMPLES})
list(APPEND APPLICATIONS ${target})
add_test( ${target}_test ${target} )
target_link_libraries( ${target} PRIVATE exiv2lib)
target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find unused.h
install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
@ -80,6 +81,7 @@ if( EXPAT_FOUND )
list(APPEND APPLICATIONS geotag)
target_link_libraries( geotag PRIVATE exiv2lib ${EXPAT_LIBRARIES})
target_include_directories(geotag PRIVATE ${EXPAT_INCLUDE_DIR})
target_include_directories(geotag PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find unused.h
if (WIN32)
target_compile_definitions(geotag PRIVATE XML_STATIC)

@ -5,6 +5,7 @@
// g++ geotag.cpp -o geotag -lexiv2 -lexpat
#include <exiv2/exiv2.hpp>
#include "unused.h"
#include <iostream>
#include <iomanip>
@ -57,8 +58,6 @@ char* realpath(const char* file,char* path);
#define _MAX_PATH 1024
#endif
#define UNUSED(x) (void)(x)
// prototypes
class Options;
int getFileType(const char* path ,Options& options);

@ -3,6 +3,7 @@
// Sample/test for high level XMP classes. See also addmoddel.cpp
#include <exiv2/exiv2.hpp>
#include "unused.h"
#include <string>
#include <iostream>

@ -143,6 +143,7 @@ set( LIBEXIV2_PRIVATE_HDR
tifffwd_int.hpp
tiffimage_int.hpp
tiffvisitor_int.hpp
unused.h
)

@ -67,10 +67,6 @@
# include <MD5.h>
#endif // EXV_HAVE_XMP_TOOLKIT
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
// *****************************************************************************
// local declarations
namespace {

@ -0,0 +1,26 @@
/*
* Copyright (C) 2004-2018 Exiv2 authors
*
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef UNUSED_H
#define UNUSED_H
#define UNUSED(x) (void)(x)
#endif // UNUSED_H
Loading…
Cancel
Save