Skip to content

Commit 032e857

Browse files
committed
eds: move general macro definition out of edid.h
1 parent 29d73f1 commit 032e857

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

Makefile.am

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
if WITH_EXAMPLES
44
noinst_PROGRAMS = src/examples/parse-edid/parse-edid
55

6-
src_examples_parse_edid_parse_edid_SOURCES = src/examples/parse-edid/parse-edid.c \
6+
src_examples_parse_edid_parse_edid_CFLAGS = -I $(top_srcdir)/src \
7+
-I $(top_srcdir)/src/eds \
8+
-include $(top_srcdir)/src/eds/macros.h \
9+
$(NULL)
10+
src_examples_parse_edid_parse_edid_SOURCES = src/examples/parse-edid/parse-edid.c \
711
$(NULL)
8-
src_examples_parse_edid_parse_edid_CFLAGS = -I $(top_srcdir)/src \
9-
-I $(top_srcdir)/src/eds \
10-
$(NULL)
1112
endif
1213

1314
edsincludedir = $(includedir)/eds

src/eds/edid.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
#define EDID_BLOCK_SIZE (0x80)
4141
#define EDID_MAX_EXTENSIONS (0xfe)
4242

43-
#ifndef ARRAY_SIZE
44-
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
45-
#endif
46-
4743

4844
static const uint8_t EDID_HEADER[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
4945
static const uint8_t EDID_STANDARD_TIMING_DESCRIPTOR_INVALID[] = { 0x01, 0x01 };

src/eds/macros.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* vim: set et fde fdm=syntax ft=c.doxygen ts=4 sts=4 sw=4 : */
2+
/*
3+
* Copyright © 2010-2011 Saleem Abdulrasool <[email protected]>.
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright notice,
13+
* this list of conditions and the following disclaimer in the documentation
14+
* and/or other materials provided with the distribution.
15+
*
16+
* 3. The name of the author may not be used to endorse or promote products
17+
* derived from this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
22+
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
#ifndef eds_macros_h
32+
#define eds_macros_h
33+
34+
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
35+
36+
#endif
37+

0 commit comments

Comments
 (0)