Include config.h everywhere

Ref: <https://github.com/Genymobile/scrcpy/issues/829>

Suggested-by: Louis Kruger <louisk@gmail.com>
This commit is contained in:
Romain Vimont 2019-09-29 22:36:56 +02:00
parent 129dabcfa4
commit 1f8ba1ca79
43 changed files with 61 additions and 4 deletions

View file

@ -4,6 +4,8 @@
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
static inline void
buffer_write16be(uint8_t *buf, uint16_t value) {
buf[0] = value >> 8;

View file

@ -5,6 +5,8 @@
#include <stdbool.h>
#include <unistd.h>
#include "config.h"
// To define a circular buffer type of 20 ints:
// struct cbuf_int CBUF(int, 20);
//

View file

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "log.h"
#include "str_util.h"

View file

@ -33,6 +33,8 @@
#endif
#include "config.h"
# define NO_EXIT_CODE -1
enum process_result {

View file

@ -3,6 +3,8 @@
#include <stdint.h>
#include "config.h"
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)

View file

@ -2,6 +2,7 @@
#include <string.h>
#include "config.h"
#include "buffer_util.h"
#include "log.h"
#include "str_util.h"

View file

@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdint.h>
#include "config.h"
#include "android/input.h"
#include "android/keycodes.h"
#include "common.h"

View file

@ -5,6 +5,7 @@
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "cbuf.h"
#include "control_msg.h"
#include "net.h"

View file

@ -8,8 +8,8 @@
#include <SDL2/SDL_thread.h>
#include <unistd.h>
#include "compat.h"
#include "config.h"
#include "compat.h"
#include "buffer_util.h"
#include "events.h"
#include "lock_util.h"

View file

@ -4,6 +4,8 @@
#include <stdbool.h>
#include <libavformat/avformat.h>
#include "config.h"
struct video_buffer;
struct decoder {

View file

@ -1,4 +1,6 @@
#include "device.h"
#include "config.h"
#include "log.h"
bool

View file

@ -3,6 +3,7 @@
#include <stdbool.h>
#include "config.h"
#include "common.h"
#include "net.h"

View file

@ -3,6 +3,7 @@
#include <string.h>
#include <SDL2/SDL_assert.h>
#include "config.h"
#include "buffer_util.h"
#include "log.h"

View file

@ -5,6 +5,8 @@
#include <stdint.h>
#include <unistd.h>
#include "config.h"
#define DEVICE_MSG_TEXT_MAX_LENGTH 4093
#define DEVICE_MSG_SERIALIZED_MAX_SIZE (3 + DEVICE_MSG_TEXT_MAX_LENGTH)

View file

@ -1,5 +1,7 @@
#include "event_converter.h"
#include "config.h"
#define MAP(FROM, TO) case FROM: *to = TO; return true
#define FAIL default: return false

View file

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <SDL2/SDL_events.h>
#include "config.h"
#include "control_msg.h"
struct complete_mouse_motion_event {

View file

@ -5,6 +5,7 @@
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "cbuf.h"
#include "command.h"

View file

@ -3,6 +3,7 @@
#include <SDL2/SDL_assert.h>
#include <SDL2/SDL_timer.h>
#include "config.h"
#include "lock_util.h"
#include "log.h"

View file

@ -7,6 +7,8 @@
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
struct fps_counter {
SDL_Thread *thread;
SDL_mutex *mutex;

View file

@ -1,6 +1,8 @@
#include "input_manager.h"
#include <SDL2/SDL_assert.h>
#include "config.h"
#include "event_converter.h"
#include "lock_util.h"
#include "log.h"

View file

@ -3,6 +3,7 @@
#include <stdbool.h>
#include "config.h"
#include "common.h"
#include "controller.h"
#include "fps_counter.h"

View file

@ -4,6 +4,7 @@
#include <stdint.h>
#include <SDL2/SDL_mutex.h>
#include "config.h"
#include "log.h"
static inline void

View file

@ -8,8 +8,8 @@
#define SDL_MAIN_HANDLED // avoid link error on Linux Windows Subsystem
#include <SDL2/SDL.h>
#include "compat.h"
#include "config.h"
#include "compat.h"
#include "log.h"
#include "recorder.h"

View file

@ -2,6 +2,7 @@
#include <stdio.h>
#include "config.h"
#include "log.h"
#ifdef __WINDOWS__

View file

@ -17,6 +17,8 @@
typedef int socket_t;
#endif
#include "config.h"
bool
net_init(void);

View file

@ -6,6 +6,8 @@
#include <stddef.h>
#include <SDL2/SDL_assert.h>
#include "config.h"
// To define a queue type of "struct foo":
// struct queue_foo QUEUE(struct foo);
#define QUEUE(TYPE) { \

View file

@ -5,6 +5,7 @@
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "net.h"
// receive events from the device

View file

@ -3,8 +3,8 @@
#include <libavutil/time.h>
#include <SDL2/SDL_assert.h>
#include "compat.h"
#include "config.h"
#include "compat.h"
#include "lock_util.h"
#include "log.h"

View file

@ -6,6 +6,7 @@
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "common.h"
#include "queue.h"

View file

@ -7,6 +7,7 @@
#include <sys/time.h>
#include <SDL2/SDL.h>
#include "config.h"
#include "command.h"
#include "common.h"
#include "compat.h"

View file

@ -5,6 +5,8 @@
#include <stdint.h>
#include <recorder.h>
#include "config.h"
struct scrcpy_options {
const char *serial;
const char *crop;

View file

@ -5,6 +5,7 @@
#include <SDL2/SDL.h>
#include <libavformat/avformat.h>
#include "config.h"
#include "common.h"
struct video_buffer;

View file

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
#include "command.h"
#include "net.h"

View file

@ -10,6 +10,8 @@
#include <SDL2/SDL_stdinc.h>
#include "config.h"
size_t
xstrncpy(char *dest, const char *src, size_t n) {
size_t i;

View file

@ -3,6 +3,8 @@
#include <stddef.h>
#include "config.h"
// like strncpy, except:
// - it copies at most n-1 chars
// - the dest string is nul-terminated

View file

@ -8,8 +8,8 @@
#include <SDL2/SDL_thread.h>
#include <unistd.h>
#include "compat.h"
#include "config.h"
#include "compat.h"
#include "buffer_util.h"
#include "decoder.h"
#include "events.h"

View file

@ -7,6 +7,7 @@
#include <SDL2/SDL_atomic.h>
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "net.h"
struct video_buffer;

View file

@ -7,6 +7,8 @@
#include "command.h"
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <limits.h>

View file

@ -2,6 +2,8 @@
#include <unistd.h>
#include "config.h"
bool
net_init(void) {
// do nothing

View file

@ -1,5 +1,6 @@
#include "net.h"
#include "config.h"
#include "log.h"
bool

View file

@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "log.h"
struct index {

View file

@ -3,6 +3,8 @@
#include <SDL2/SDL.h>
#include "config.h"
SDL_Surface *
read_xpm(char *xpm[]);

View file

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <SDL2/SDL_mutex.h>
#include "config.h"
#include "fps_counter.h"
// forward declarations