Skip to content

Commit

Permalink
Require C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
mtheall committed Oct 10, 2017
1 parent 0176621 commit f305eeb
Show file tree
Hide file tree
Showing 15 changed files with 1,224 additions and 642 deletions.
18 changes: 9 additions & 9 deletions buildscript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ libbzip2_PATH := bzip2-1.0.6
libbzip2_CONFIGURE := /bin/true
libbzip2_MAKE := PREFIX="$(COMMON_PREFIX)"

libjpeg_PKG := libjpeg-turbo-1.5.1.tar.gz
libjpeg_PATH := libjpeg-turbo-1.5.1
libjpeg_PKG := libjpeg-turbo-1.5.2.tar.gz
libjpeg_PATH := libjpeg-turbo-1.5.2
libjpeg_CONFIGURE := $(COMMON_CONFIGURE)

libtiff_PKG := tiff-4.0.7.tar.gz
libtiff_PATH := tiff-4.0.7
libtiff_PKG := tiff-4.0.8.tar.gz
libtiff_PATH := tiff-4.0.8
libtiff_CONFIGURE := $(COMMON_CONFIGURE)

libpng_PKG := libpng-1.6.28.tar.xz
libpng_PATH := libpng-1.6.28
libpng_PKG := libpng-1.6.34.tar.xz
libpng_PATH := libpng-1.6.34
libpng_CONFIGURE := $(COMMON_CONFIGURE)

zlib_PKG := zlib-1.2.11.tar.xz
zlib_PATH := zlib-1.2.11
zlib_CONFIGURE := ./configure --static --prefix=$(COMMON_PREFIX)

ImageMagick_PKG := ImageMagick.tar.gz
ImageMagick_PATH := ImageMagick-7.0.4-9
ImageMagick_CONFIGURE := $(COMMON_CONFIGURE) --disable-openmp --with-gslib=no --without-freetype --without-lcms --without-openexr --without-webp --without-x
ImageMagick_PATH := ImageMagick-7.0.7-4
ImageMagick_CONFIGURE := $(COMMON_CONFIGURE) --disable-openmp --with-gslib=no --without-fontconfig --without-freetype --without-lcms --without-openexr --without-pango --without-webp --without-x --without-xml

export LD_LIBRARY_PATH := "$(COMMON_PREFIX)/lib"
export PKG_CONFIG_PATH := "$(LD_LIBRARY_PATH)/pkgconfig"
Expand All @@ -39,7 +39,7 @@ all:
tex3ds: ImageMagick
@cd .. && \
./autogen.sh && \
./configure PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG="pkg-config --static" && \
./configure PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG="pkg-config --static" --prefix=$(DEVKITARM) && \
$(MAKE) LDFLAGS="-static -pthread" && \
strip $@

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS+=" -Wall"])
AX_CHECK_COMPILE_FLAG([-pthread], [CPPFLAGS+=" -pthread" LDFLAGS+=" -pthread"])
AX_CHECK_COMPILE_FLAG([-flto], [CPPFLAGS+=" -flto" LDFLAGS+=" -flto"])
AX_CHECK_COMPILE_FLAG([-pipe], [CPPFLAGS+=" -pipe"])
AX_CHECK_COMPILE_FLAG([-std=c++11], [CXXFLAGS+=" -std=c++11"])
AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
AC_LANG_POP()

AC_CHECK_PROGS([DOXYGEN], [doxygen])
Expand Down
8 changes: 8 additions & 0 deletions include/atlas.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ struct Atlas
Magick::Image img;
std::vector<SubImage> subs;

Atlas()
{ }

Atlas(const Atlas &other) = delete;
Atlas(Atlas &&other) = default;
Atlas& operator=(const Atlas &other) = delete;
Atlas& operator=(Atlas &&other) = delete;

static Atlas build(const std::vector<std::string> &paths);
};
46 changes: 0 additions & 46 deletions include/compat.h

This file was deleted.

1 change: 0 additions & 1 deletion include/compress.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
/** @brief Compression header size */
#define COMPRESSION_HEADER_SIZE 8

#include "compat.h"
#ifdef __cplusplus
#include <cassert>
extern "C"
Expand Down
15 changes: 13 additions & 2 deletions include/encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
* for ETC1/ETC1A4 which do not involve swizzling.
*/
#pragma once
#include "compat.h"
#include "magick_compat.h"
#include "rg_etc1.h"
#include "subimage.h"
#include <cassert>
#include <vector>

/** @namespace encode
Expand Down Expand Up @@ -88,7 +88,12 @@ encode<uint32_t>(const uint32_t &in, Buffer &out)
template<> inline void
encode<float>(const float &in, Buffer &out)
{
encode<uint16_t>(in * 1024, out);
constexpr uint16_t scale = 1024;

assert(in >= 0);
assert(in <= std::numeric_limits<uint16_t>::max() / scale);

encode<uint16_t>(in * scale, out);
}

/** @brief Encode sub-image
Expand Down Expand Up @@ -147,6 +152,12 @@ struct WorkUnit
process(process)
{ }

WorkUnit() = delete;
WorkUnit(const WorkUnit &other) = delete;
WorkUnit(WorkUnit &&other) = default;
WorkUnit& operator=(const WorkUnit &other) = delete;
WorkUnit& operator=(WorkUnit &&other) = default;

/** @brief Work unit comparator
* @param[in] other Work unit to compare
* @returns sequence > other.sequence
Expand Down
19 changes: 7 additions & 12 deletions include/magick_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* - Magick::PixelPacket removed
*/
#pragma once
#include "compat.h"
#include <algorithm>
#include <Magick++.h>

Expand Down Expand Up @@ -138,7 +137,7 @@ class PixelPacket
Magick::Quantum *pixel; ///< Pixel referenced

/** @brief Default constructor */
Reference() DELETE_CONSTRUCTOR;
Reference() = delete;

/** @brief Constructor
* @param[in] cache Pixel cache
Expand All @@ -152,26 +151,24 @@ class PixelPacket
/** @brief Copy constructor
* @param[in] other Reference to copy
*/
Reference(const Reference &other);
Reference(const Reference &other) = default;

/** @brief Copy constructor
* @param[in] other Reference to copy
*/
Reference(Reference &&other) = default;

/** @brief Assignment operator
* @param[in] other Reference to assign
* @returns reference to self
*/
Reference& operator=(const Reference &other);

#if __cplusplus >= 201103L
/** @brief Copy constructor
* @param[in] other Reference to copy
*/
Reference(Reference &&other) = default;

/** @brief Assignment operator
* @param[in] other Reference to assign
* @returns reference to self
*/
Reference& operator=(Reference &&other);
#endif

/** @brief Assignment operator
* @param[in] c Color to assign
Expand Down Expand Up @@ -202,7 +199,6 @@ class PixelPacket
*/
PixelPacket& operator=(const PixelPacket &other);

#if __cplusplus >= 201103L
/** @brief Copy constructor
* @param[in] other PixelPacket to copy
*/
Expand All @@ -213,7 +209,6 @@ class PixelPacket
* @returns reference to self
*/
PixelPacket& operator=(PixelPacket &&other);
#endif

/** @brief Index operator
* @param[in] index Pixel index
Expand Down
76 changes: 0 additions & 76 deletions include/tex3ds.h

This file was deleted.

Loading

0 comments on commit f305eeb

Please sign in to comment.