summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2018-11-30 10:54:26 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2018-12-03 09:21:23 +0000
commitb99da21657d4f6bad415a87b82ac0d9c738018e7 (patch)
tree6eb5eba17c69c4412bc0e66ad89529fb5c5e3bb1 /lib
parentb4935e9a4db6f2e6cc4217678204e951f694fad3 (diff)
lib: Fix class and namespace usage
The (dummy) init_lib function was linking correctly only due to a namespace 'collision' adding the init_lib to libcamera namespace, which is 'shared' by class libcamera. The init function was designed to be a class member function of the libcamera object - and is used as such in the existing test function. Instead of relying on the namespace collision - update the lib/main.cpp example file to correctly utilise the class header - and specify the function declaration, so that further implementations do not fall into the same bad habits. Reported-by: Jacopo Mondi <jacopo@mondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/main.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/main.cpp b/lib/main.cpp
index 7b3da269..37f1ccce 100644
--- a/lib/main.cpp
+++ b/lib/main.cpp
@@ -1,13 +1,10 @@
#include <iostream>
-
-namespace libcamera {
+#include <libcamera/libcamera.h>
using std::cout;
using std::endl;
-void init_lib(void)
+void libcamera::init_lib(void)
{
cout << "Lib Camera Init" << endl;
}
-
-};