remove c99 and c++11 restrictions

This commit is contained in:
Philippe Teuwen 2020-04-19 22:55:28 +02:00
commit fbe4e20326
20 changed files with 28 additions and 30 deletions

View file

@ -12,8 +12,6 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
set(CMAKE_CXX_STANDARD 14)
if(APPLE AND EXISTS /usr/local/opt/qt5)
# Homebrew installs Qt5 (up to at least 5.11.0) in
# /usr/local/qt5. Ensure that it can be found by CMake

View file

@ -57,7 +57,7 @@ LIBS = -I$(LUALIBPATH) -I$(MBEDTLSLIBPATH) -I$(JANSSONLIBPATH) -I$(CBORLIBPATH)
INCLUDES_CLIENT = -I./src -I../include -I../common -I../common_fpga $(LIBS)
CFLAGS ?= -Wall -Werror -O3
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
PM3CFLAGS = $(CFLAGS) -std=c99 $(INCLUDES_CLIENT)
PM3CFLAGS = $(CFLAGS) $(INCLUDES_CLIENT)
# WIP Testing
#PM3CFLAGS = $(CFLAGS) -std=c11 -pedantic $(INCLUDES_CLIENT)
PREFIX ?= /usr/local
@ -101,7 +101,7 @@ ifneq ($(SKIPQT),1)
MOC = $(shell pkg-config --variable=moc_location QtCore)
UIC = $(shell pkg-config --variable=uic_location QtCore)
else
PM3CXXFLAGS += -std=c++11 -fPIC
PM3CXXFLAGS += -fPIC
endif
ifeq ($(QTINCLUDES), )
# if both pkg-config commands failed, search in common places
@ -111,7 +111,7 @@ ifneq ($(SKIPQT),1)
ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
QTINCLUDES += -I$(QTDIR)/include/QtWidgets
QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core
PM3CXXFLAGS += -std=c++11 -fPIC
PM3CXXFLAGS += -fPIC
endif
MOC = $(QTDIR)/bin/moc
UIC = $(QTDIR)/bin/uic

View file

@ -5,8 +5,6 @@
#amiitool.c $(MYSRCS) ../../../../common/../../commonutil.c ../ui.c -lreadline -lm ../../../../common/mbedtls/libmbedtls.a \
#-o amiitool
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(amiibo STATIC
amiitool/amiibo.c
amiitool/drbg.c

View file

@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I. -I.. -I../jansson -I../../../common -I../../../include
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
MYSRCS = \
amiibo.c \

View file

@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I../../../common -I../../../include -I../../src
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
MYSRCS = \
argtable3.c \

View file

@ -1,5 +1,3 @@
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(hardnested_nosimd OBJECT
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)

View file

@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I../../../common -I../../../include -I../../src -I../jansson
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
MYSRCS = hardnested_bruteforce.c

View file

@ -20,7 +20,7 @@
//-----------------------------------------------------------------------------
// To compile it:
// gcc -std=c99 -I ../../common -o hardnested_tables hardnested_tables.c
// gcc -I../../../common -I../../../include -o hardnested_tables hardnested_tables.c
#include <inttypes.h>
#include <stdbool.h>

View file

@ -1,5 +1,3 @@
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(jansson STATIC
jansson/dump.c
jansson/error.c

View file

@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I.
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE -Wno-unused-function
MYCFLAGS = -Wno-unused-function
MYDEFS = -DHAVE_STDINT_H
MYSRCS = \
dump.c \

View file

@ -1,7 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I.
# Lua lib is not ready for C99 style...
#MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
# Lua lib requires GNU extensions (implicit declarations of functions): -std=gnu99 or -std=gnu11
MYCFLAGS =
MYDEFS = -DLUA_COMPAT_ALL $(SYSCFLAGS)
MYSRCS = lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \

View file

@ -1,5 +1,3 @@
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(mbedtls STATIC
../../common/mbedtls/aes.c
../../common/mbedtls/asn1parse.c

View file

@ -1,5 +1,3 @@
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(reveng STATIC
reveng/bmpbit.c
reveng/cli.c

View file

@ -5,7 +5,7 @@
MYSRCPATHS =
MYINCLUDES = -I../cliparser
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS = -DPRESETS
MYSRCS = \
bmpbit.c \

View file

@ -1,7 +1,6 @@
MYSRCPATHS =
MYINCLUDES =
# Strange errors on Mingw when compiling with C99
#MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
MYSRCS = \

View file

@ -1,5 +1,3 @@
set_property(SOURCE PROPERTY C_STANDARD 99)
add_library(z STATIC
../../common/zlib/deflate.c
../../common/zlib/adler32.c

View file

@ -1,6 +1,6 @@
MYSRCPATHS =
MYINCLUDES = -I. -I..
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
MYSRCS = \
aes.c \

View file

@ -1,7 +1,7 @@
MYSRCPATHS = ../../common/zlib
MYSRCS = deflate.c adler32.c trees.c zutil.c inflate.c inffast.c inftrees.c
MYINCLUDES = -I../../common/zlib
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS = -DZ_SOLO -DNO_GZIP -DZLIB_PM3_TUNED
#-DDEBUG -Dverbose=1

View file

@ -1,7 +1,7 @@
MYSRCPATHS = ../../common ../../common/crapto1
MYSRCS = crypto1.c crapto1.c bucketsort.c
MYINCLUDES = -I../../include -I../../common
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
BINS = mfkey32 mfkey32v2 mfkey64
@ -9,6 +9,13 @@ INSTALLTOOLS = $(BINS)
include ../../Makefile.host
# checking platform can be done only after Makefile.host
ifneq (,$(findstring MINGW,$(platform)))
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
# and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
CFLAGS += -D_ISOC99_SOURCE
endif
mfkey32 : $(OBJDIR)/mfkey32.o $(MYOBJS)
mfkey32v2 : $(OBJDIR)/mfkey32v2.o $(MYOBJS)
mfkey64 : $(OBJDIR)/mfkey64.o $(MYOBJS)

View file

@ -1,7 +1,7 @@
MYSRCPATHS = ../../common ../../common/crapto1
MYSRCS = crypto1.c crapto1.c bucketsort.c
MYINCLUDES = -I../../include -I../../common
MYCFLAGS = -std=c99 -D_ISOC99_SOURCE
MYCFLAGS =
MYDEFS =
BINS = nonce2key
@ -9,4 +9,11 @@ INSTALLTOOLS = $(BINS)
include ../../Makefile.host
# checking platform can be done only after Makefile.host
ifneq (,$(findstring MINGW,$(platform)))
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
# and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
CFLAGS += -D_ISOC99_SOURCE
endif
nonce2key : $(OBJDIR)/nonce2key.o $(MYOBJS)